.gallery {
    font-size: 0;
}

.gallery-item {
    display: inline-block;
    vertical-align: top;
    font-size: 1rem;

    .gallery-columns-1 & { width: percentage( 1/1 ); }
    .gallery-columns-2 & { width: percentage( 1/2 ); }
    .gallery-columns-3 & { width: percentage( 1/3 ); }
    .gallery-columns-4 & { width: percentage( 1/4 ); }
    .gallery-columns-5 & { width: percentage( 1/5 ); }
    .gallery-columns-6 & { width: percentage( 1/6 ); }
    .gallery-columns-7 & { width: percentage( 1/7 ); }
    .gallery-columns-8 & { width: percentage( 1/8 ); }
    .gallery-columns-9 & { width: percentage( 1/9 ); }
}