JSFiddle - React, Tailwind, and code Playground

HTML

<!-- 100x50 -->
<img class="resize-double" src="https://placeimg.com/100/50/nature">

<!-- 200x100 [ NO RESIZE ] -->
<img src="https://placeimg.com/200/100/nature">

<!-- 200x100 -->
<img class="resize-double" src="https://placeimg.com/200/100/nature">

<!-- 400X200 [ NO RESIZE ] -->
<img src="https://placeimg.com/400/200/nature">

JavaScript

// Select all images to be resized
const toResizeImgs = document.querySelectorAll(".resize-double");

// Loop over those images and double their size
for(let i=0; i < toResizeImgs.length; i++) {
  toResizeImgs[i].style.width = toResizeImgs[i].offsetWidth * 2 + "px";
  toResizeImgs[i].style.height = toResizeImgs[i].offsetHeight + "px";
}