Refactoring for GalleryService