I have this attempt of gallery of images with bootstrap, but I do not manage to appear bada, this is the complete code of the gallery, the images are named by numbers.
<script>
var imagenes = [1,2,3,4,5,6,7,8,9];
var galeria = Document.getElementById('galeria');
for(imagen of imagenes){
galeria.innerHTML +=
'
<div class="card">
<a href="#" data-toggle="modal" data-target="#id${imagen}">
<img src="imgs/galery/${imagen}.jpg" alt="" class="card-img-top">
</a>
</div>
<div class="modal fade" id="id${imagen}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true">
<button type="button" class="close mr-2" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<div class="modal-dialog modal-dialog-centered" role="document">
<img src="imgs/galery/${imagen}.jpg" alt="" class="img-fluid rounded">
</div>
</div>
'
}
</script>