Added check for galleryService in mainController scope