JSFiddle - React, Tailwind, and code Playground

HTML

<div style="float: left; width: 100px; border: solid 1px #000;">
  <div align='right' class='content-container'>
    <img class='image1' style="display: block;" src="..." />
    <img class='image2' style="display: block;" src="..." />
  </div> 
</div>

CSS

.image1 {
    width: 50px;
}
.image2 {
    width: 30px;
}

JavaScript

$('.container').width($('.image1').width());