
 .gallery-ul{
    display: flex;
    flex-wrap: wrap;
     max-width: 80vw;
     margin: 0 auto;
}

.gallery-li {
    height: 40vh;
    flex-grow: 1;
}

.gallery-li-last {
// There's no science in using "10" here. In all my testing, this delivered the best results.
flex-grow: 10;
}

.gallery-img {
    max-height: 100%;
    min-width: 100%;
    object-fit: cover;
    vertical-align: bottom;
}



@media (max-aspect-ratio: 1/1) {
    .gallery-li {
        height: 30vh;
    }
}



@media (max-height: 480px) {
    .gallery-li {
        height: 80vh;
    }
}



@media (max-aspect-ratio: 1/1) and (max-width: 480px) {
    .gallery-ul {
        flex-direction: row;
        max-width: 90vw;
    }

    .gallery-li {
        height: auto;
        width: 100%;
    }
    .gallery-img {
        width: 100%;
        max-height: 75vh;
        min-width: 0;
    }
}