adding hooks for galleries