How to use links with lightbox2

Hey I’m having a hard time getting lightbox2 from to work on a jekyll site. The behavior should be that when I click on a link it should stay on the photography page and show the lightbox right. But instead it brings me to -> localhost:4000/assets/uploads/cuba-2-1370.jpg

So obviously I am missing something about how links work in jekyll but the stuff I find online is only about permalinks in relation with pages and posts, not with internal links or something which I need here right ?

layout: default
title: Photography
permalink: /photography/

<section class="page-heading">
  <div class="container">
    <p class="section-title">
      {{ page.title | upcase }}

<section class="photography">
  <div class="container">
    <div class="photography-flex-row" id="photo-list">
      {% assign sorted = | sort: 'date' | reverse %}
      {% for item in sorted %}
      <div class="photography-flex-item photography-item">
        <a href="/assets/uploads/{{ item.img | append: '-1370' }}.jpg" data-lightbox="mygallery">
            <source srcset="/assets/uploads/{{ item.img }}.webp" type="image/webp" alt="{{ item.alt }}">
            <img src="/assets/uploads/{{ item.img }}.jpg" class="img-fluid" alt="{{ item.alt }}">
      {% endfor %}

Oeps I used the slim version of jquery but lightbox doesn’t work with that. It works now!