Integrating Brett changes (sub-galleries support)
--Fixed bug that created empty galleries