fixed the imagesLoaded bug with new JS file