fix reading template object for AddGallery