Update image preloading code for lazy loading with src attribute