What jquery solution are you using to make the big image appear?
There is literally probably a million ways to do this in jQuery or plain javascript.
One example is below:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery Image Gallery</title>
<style>
* {
box-sizing: border-box;
}
img {
max-width: 100%;
}
.gallery-wrapper {
width: 75%;
margin: 0 auto;
text-align: center;
}
@media screen and (max-width: 768px) {
.gallery-wrapper {
width: 90%;
}
}
@media screen and (max-width: 480px) {
.large-image {
display: none;
}
}
.large-image img {
padding: 10px;
border: 1px solid #ccc;
}
figure {
margin: 0;
padding: 0;
}
figcaption {
padding: 5px 0 15px 0;
}
.thumbnail-wrapper {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.thumbnail {
width: 24%;
height: auto;
}
@media screen and (max-width: 480px) {
.thumbnail {
width: 100%;
}
}
.thumbnail figcaption {
display: none;
}
@media screen and (max-width: 480px) {
.thumbnail figcaption {
display: block;
}
}
</style>
</head>
<body>
<div class="gallery-wrapper">
<div class="large-image">
<figure><img src="https://images.pexels.com/photos/731022/pexels-photo-731022.jpeg" alt="Dog Image 1">
<figcaption>©Christian Domingues / pexels.com</figcaption>
</figure>
</div>
<!--large-image-->
<div class="thumbnail-wrapper">
<div class="thumbnail">
<figure>
<img src="https://images.pexels.com/photos/731022/pexels-photo-731022.jpeg" alt="©Christian Domingues / pexels.com">
<figcaption>©Christian Domingues / pexels.com</figcaption>
</figure>
</div>
<div class="thumbnail">
<figure>
<img src="https://images.pexels.com/photos/805306/pexels-photo-805306.jpeg" alt="©Jodie DS / pexels.com">
<figcaption>©Jodie DS / pexels.com</figcaption>
</figure>
</div>
<div class="thumbnail">
<figure>
<img src="https://images.pexels.com/photos/551628/pexels-photo-551628.jpeg" alt="©Kat Jayne / pexels.com">
<figcaption>©Kat Jayne / pexels.com</figcaption>
</figure>
</div>
<div class="thumbnail">
<figure>
<img src="https://images.pexels.com/photos/179107/pexels-photo-179107.jpeg" alt="©Adrianna Calvo / pexels.com ">
<figcaption>©Adrianna Calvo / pexels.com</figcaption>
</figure>
</div>
</div>
<!--end thumbnail-wrapper-->
</div>
<!--end gallery-wrapper-->
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script>
$('.thumbnail img').click(function(){
var imgSrc = $(this).attr('src');
var imgCap = $(this).attr('alt');
$('.large-image').css('display','none');
$('.large-image').fadeIn().html('<figure><img src="' + imgSrc + '"><figcaption>' + imgCap + '</figcaption></figure>')
});
</script>
</body>
</html>