JSFiddle - React, Tailwind, and code Playground
HTML
<span></span>
<hr>
<img src="https://s-media-cache-ak0.pinimg.com/474x/37/51/24/3751248ab77a57997e2a991d39c464ab.jpg">
JavaScript
imgs = [
'http://www.archi-europe.com/pictures/DRDH_1.jpg',
'http://c1038.r38.cf3.rackcdn.com/group1/building1978/media/bodo_kulturhus_drdh060309_5.jpg',
'http://static.dezeen.com/uploads/2010/08/dzn_Bod%C3%B8-Kulturhus-and-Library-by-drdharchitects-1.jpg',
'http://www.buildwithlingo.com/sites/lingo/uploads/images/projects/Beacon_Hill/_thumbs/Rendering-720-430-crop.png',
];
counter = 0;
setInterval(function() {
$('span').text(counter);
$('img').attr('src', imgs[counter++]);
if(counter == imgs.length) {
counter = 0;
}
}, 1000);