Add ugly implementation of photo cache.