JSFiddle - React, Tailwind, and code Playground

HTML

<img src="" id="image"

CSS

#image {
  border: 2px solid red;
  width: 400px;
  height: 200px;
}

JavaScript

var image1 = "https://pixabay.com/static/uploads/photo/2016/06/17/13/02/duck-1463317_960_720.jpg";
var image2 = "https://pixabay.com/static/uploads/photo/2013/09/22/16/56/duck-185014_960_720.jpg";
var image3 = "https://pixabay.com/static/uploads/photo/2013/11/02/03/23/ducks-204332_960_720.jpg";

$(function() {
  $("#image").prop("src", image1);
  setInterval(function() {
    $("#image").prop("src", image2);
    setTimeout(function() {
      $("#image").prop("src", image1);
      setTimeout(function() {
        $("#image").prop("src", image3);
      }, 500);
      setTimeout(function() {
        $("#image").prop("src", image2);
      }, 1000);
    }, 1500);
  }, 5000);
});