Why isn't my lazy loading for images functioning properly?

the src attribute is actually fine to display a placeholder, you can overwrite the value with JS on the onload image event. Without a closer look at how that code is implemented, that is the best direction that I can provide.