Started cleaning the gallery.js