adds imagesLoaded to main.js and corrects a few structural things in various template and lib files