JSFiddle - React, Tailwind, and code Playground

HTML

<img id="dev" style="background-size: cover; background-image: url(https://image.freepik.com/free-icon/no-translate-detected_318-52837.jpg);"/>
 
 
 <img onclick="imgCH(this);" style="background-size: cover; background-image: url(https://cdn1.iconfinder.com/data/icons/animals-18/154/cat-seat-skin-body-animal-512.png);">
 
  <img onclick="imgCH(this);" style="background-size: cover; background-image: url(http://icons.iconarchive.com/icons/sonya/swarm/256/Cat-icon.png);">
   <img onclick="imgCH(this);" style="background-size: cover; background-image: url(https://d30y9cdsu7xlg0.cloudfront.net/png/1836-200.png)">

CSS

img {
    height: 150px;
    width: 150px;
}

JavaScript

function imgCH(imgDIV)
{
   document.getElementById("dev").style.backgroundImage = imgDIV.style.backgroundImage;
}