.image { width: calc(100% / var(--gallery-splits)); padding-bottom: calc(100% / var(--gallery-splits)); height: 0; background: red; background-size: cover; background-position: center; }