jQuery('#grid-wrapper').imagesLoaded( function() { jQuery('#grid').Mosaic( { maxRowHeight: 250, maxRowHeightPolicy: 'oversize', // maxRows: 4, innerGap: 7, responsiveWidthThreshold: 300, showTailWhenNotEnoughItemsForEvenOneRow: 12, defaultAspectRatio: 1, } ); });