JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<div class="row-fluid" id="theContainer">
  <div class="col-sm-6 resizeMe">
    <img class="filler" src="http://www.keenthemes.com/preview/metronic/theme/assets/global/plugins/jcrop/demos/demo_files/image1.jpg" />
    <img class="filler" src="http://www.keenthemes.com/preview/metronic/theme/assets/global/plugins/jcrop/demos/demo_files/image2.jpg" />
  </div>
  <div class="col-sm-6">
    <img class="main-img" src="http://joombig.com/demo-extensions1/images/gallery_slider/Swan_large.jpg" />
  </div>
</div>
<div class="row-fluid">
<div class="col-xs-12">
	<h2 class="theWidth"></h2>
	Change the viewport width and rerun.<hr />
		<div id="theBody">
			<span class="sm6"></span>
			<span class="imgH"></span>
		</div>
		<div id="DOMready">
			<span class="sm6"></span>
			<span class="imgH"></span>
		</div>
		<div id="onLoad">
			<span class="sm6"></span>
			<span class="imgH"></span>
		</div>
</div>
</div>

CSS

.main-img {
  width: 100%;
  height: auto
}
#theContainer {
  margin-top: 15px;
}
/* body {width: 100vw;} */

JavaScript

document.initPictures = function() {
  $('.resizeMe').css({
    'height': $('#theContainer .col-sm-6').eq(1).height() + 6,
    'display': 'flex',
    'flex-direction': 'column',
    'transition': 'height .4s cubic-bezier(0.55, 0, 0.55, 0.2)'
  });
  $('.resizeMe img').each(function() {
    var src = $(this).attr('src');
    $('.resizeMe').append('<div style="flex-basis: 50%; background-image: url(' + src + '); background-size:cover; background-position: center center"' + '</div>');
    $(this).remove();
  })
};
document.resizePictures = function() {
  if ($('#theContainer').outerWidth() > 768) {
    $('.resizeMe').css({
      'height': $('#theContainer .col-sm-6').eq(1).height()
    });
  } else {
    $('.resizeMe').css({
      'height': $('.resizeMe').outerWidth()
    });
  }
	$('.theWidth').text($('body').outerWidth());
};
$('.theWidth').text('body width is first: ' + $('body').outerWidth());
setTimeout(function(){
    $('.theWidth').text($('.theWidth').text() + ' and than: '+ $('body').outerWidth());
}, 1000)

$(window).resize(function() {
  document.resizePictures();
});

/* THIS EXECUTES FIRST */
document.initPictures();

var sm6height = $('#theContainer .col-sm-6').eq(1).height();
var imgHeight = $('#theContainer .col-sm-6').eq(1).find('img').height();
console.log("When called in <body>:");
console.log("#theContainer .col-sm-6 height: " + sm6height);
$('#theBody .sm6').text(sm6height);
console.log("Image height: " + imgHeight);
$('#theBody .imgH').text(imgHeight);

$(document).ready(function(){
	var sm6height = $('#theContainer .col-sm-6').eq(1).height();
	var imgHeight = $('#theContainer .col-sm-6').eq(1).find('img').height();
	console.log("When called in DOM Ready:");
	console.log("#theContainer .col-sm-6 height: " + sm6height);
	$('#DOMready .sm6').text(sm6height);
	console.log("Image height: " + imgHeight);
	$('#DOMready .imgH').text(imgHeight);
});

window.onload = function(){
	var sm6height = $('#theContainer .col-sm-6').eq(1).height();
	var imgHeight...