$(document).ready(function(){

    $('.contains-grid').each( function( i, gridContainer ) {
        var $gridContainer = $( gridContainer );
        // init isotope for container
        var $grid = $gridContainer.find('.grid').imagesLoaded( function() {
            $grid.isotope({
                itemSelector: '.b-grid-item',
                percentPosition: true,
                // layout mode options
                masonry: {
                    columnWidth: '.b-grid-sizer',
                    gutter: '.b-grid-gutter'
                }
            })
        });
    });




});