JSFiddle - React, Tailwind, and code Playground
HTML
<div class="gallery">
<img src="//lorempixel.com/200/200" />
<div class="overlaydiv"> </div>
</div>
CSS
.overlaydiv
{
width:430px;
height:430px;
position:absolute;
top:0px;
left:0px;
z-index:2;
background:white;
background-image:url("http://www.arabianbusiness.com/skins/ab.main/gfx/loading_spinner.gif");
background-position: 100px;
background-repeat:no-repeat;
opacity:0.99;
}
JavaScript
$(".gallery img").each(function () {
$(this).attr("src",$(this).attr("src").replace("200/200", "400/400"));
setTimeout(function(){
$(".overlaydiv").hide();
},1000);
});