<style>
    div.gallery {
        display: flex;
        flex-wrap: wrap;
    }
    div.gallery a {
        flex-grow: 1;
        object-fit: cover;
        margin: 2px;
        display: flex;
    }

    div.gallery a img {            
        height: 200px;
        object-fit: cover;
        flex-grow: 1;
    }

</style>


<div class="gallery">
    {{ $path := print "static/" (.Page.Dir) (.Get "src") }}
    {{ $url  := print .Site.BaseURL (.Get "src") }}
    {{ range shuffle (.Page.Resources.ByType "image") }}
        {{ if in .Name "." }}
        {{ $thumb := .Fit "640x640" }}
        <a href="{{ .RelPermalink }}" target="_blank">
            <img src="{{ $thumb.RelPermalink }}">  <br/>            
        </a>
        {{ end }}
    {{ end }}
</div>

