chapter 27 - adding caching for images and preloading images