Some refactoring and check for imagesLoaded-Plugin