Getting duplicate image post entries in simple gallery loop

Hi all, hoping you can help. I posted yesterday about this but my post got removed due to the spambot. No idea why but it might be cos I included links.

So, Im developing a gitub pages site and I need help about why my simple gallery images are printing twice.

Code

<!-- gallery html from https://dmnfarrell.github.io/software/jekyll-galleries -->
<div class="thumb-wrap"><div id="image-gallery">
    {% assign sorted = site.static_files | sort: 'date' | reverse %}
    {% for file in sorted %}
    {% if file.path contains include.folder %}
    {% if file.extname == '.jpg' or file.extname == '.png' %}
    {% assign filenameparts = file.path | split: "/" %}
    {% assign filename = filenameparts | last | replace: file.extname " " %}
    <div class="box">
    <a href="{{site.baseurl}}{{ site.imagesurl }}{{ include.folder }}/{{ file.name }}" title="{{ filename }}"><img src="{{site.baseurl}}{{ site.thumbsurl }}{{ include.folder }}/{{ file.name }}" alt="{{ filename }}" class="img-gallery" /> </a>
    </div>
    {% endif %}
    {% endif %} 
    {% endfor %} 
</div></div>

Im declaring imagesurl and thumbsurl in the config yaml.

imagesurl: "/assets/galleries/"
thumbsurl: "/assets/thumbs/"

The method Im using is from Damien Farrell. I wont link to his blogpost in case this post is removed again due to spambot. I can share my repo and the site url but wont in case spambot :slight_smile:

This post was held up in spam bin for 2 days, and the post it refers to is still held in spam. Since then I have solved the issue by completely replacing the dmfarrell liquid data call which does not work.

tbh Im a bit disappointed in the spam bot as Ive posted before and not had the akismet problem. If we cant post and get help in a timely fashion then what is the point of the forum??