refactored importer utilities and added initial galleryimporter (re #215)