.ipWidget-IpImageGallery {
    margin-bottom: (@ipWidgetSpace - @ipImageGallerySpace); // fixing bottom margin between widgets

    ul {
        list-style: none;
        margin: 0 -(@ipImageGallerySpace / 2); // hack to keep images visually from border to border
    }

    li {
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        float: left;
        margin-bottom: @ipImageGallerySpace;
        padding: 0 (@ipImageGallerySpace / 2);
        width: (100% / @ipImageGalleryColumns);

        img {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box; // for width to make sense if padding/borders are added
            display: block;
            width: 100%; // image will always be same size as column width
        }
    }

    // adapting to small screens
    @media screen and (max-width: @ipImageGalleryScreenSmall){
        ul {
            margin: 0 -(@ipImageGallerySpaceSmall / 2);
        }

        li {
            width: (100% / @ipImageGalleryColumnsSmall);
            margin-bottom: @ipImageGallerySpaceSmall;
            padding: 0 (@ipImageGallerySpaceSmall / 2);
        }
    }
}
