conditionally add masonry classes