how to show each image when clicked and show them in a modal

What I am looking for is that the user, when clicking on any image, opens a modal with that same image in a large size.

What I have achieved so far is that only the first image is displayed, because clicking on the others does not interact with anything.

image gallery
only image that is activated

this image is from image gallery code in django
gallery code

This image is of the modal code that is displayed when clicking on an image
modal image zoom

and this image is of the js code
modal image zoom js

From now on, sorry for my bad English.
I hope you can understand me and help if you can, thank you!