JSFiddle - React, Tailwind, and code Playground

HTML

<img id="random-image" src="http://lorempixel.com/100/100" alt="">

JavaScript

var img = document.getElementById('random-image');
var url = img.src;

function f () {
  img.src = url+'?_='+Date.now();
  setTimeout(f, 5000);
}

setTimeout(f, 5000);