Code works fine for both masonry and lightbox. Added working code in home.html