added support for uploading images for gallery and groups