Vid 2069 Fixing order of showing, hiding, and loading indicator of gallery toggle buttons

I've moved the rendering of the toggler into it's own file in order to simplify gallery.js a bit. A lot of the functionality of the toggler is still in gallery.js, which isn't ideal, but I plan to leave it like this for now, and possibly revisit it later. 

This PR mainly updates the order in which toggler handlers are called to make sure you still see a loading graphic while the last group of images are loading.