end of chapter 27 - PhotoGallery
also implemented caching