JSFiddle - React, Tailwind, and code Playground

by Aqeel Javed Qureshi

HTML

<img src="http://i.ijjstockimg.com/file_thumbview_approve/26964040/2/stock-photo-26964040-shopping.jpg" alt="Image1" />
<img src="http://i.istockimg.com/file_thumbview_approve/36331162/2/stock-photo-36331162-african-school-kids.jpg" alt="Image2" style="height:1px;" />

JavaScript

$('img').each(function () {
    var Image = $(this);
    $(window).on('load', function () {
        if (Image.width() <= 1 || Image.height() <= 1) {
            Image.attr('src', '/ImagePath');
        }
    });
    $(document).ready(function () {
        Image.error(function () {
            Image.attr('src', '/ImagePath');
        });
    });
});