adding support for gallery