Adds caching to the photo gallery.