simplification of image preloading loop