Separate gallery.js into sevral files