/* add a background colour if you want (optional) */ .gallery-grid-item-wrapper { background:black; } /* change to contain (default is cover) */ .gallery-grid-item-wrapper img { object-fit: contain !important; }