Added caching for the number of photos in a groop