Added code to preload images for the background