resolved some issues with gallery