update gallery classes

copied gallery classes from the 'develop' branch