add code for galleries