updated script and styling for masonry