added invokeGallery function