Refactor code: Create GalleryController