image/gif was stretched even though width/height was set

Use object-fit:contain in CSS styles to contain image inside width/height. <div class=”swatch-loader” style=”text-align:center;”><img src=”<?php echo $this->getSkinUrl(‘images/ajaxcartpopup/loading.gif’);?>” width=”17″ height=”17″ style=”object-fit:contain;display:inline;” /></div>