title: Bootstrap: how to truly center an image in a column?
body: <p>I'd like to put 4 images in 4 stacked columns using Bootstrap. Here is my code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;Bootstrap Example&lt;/title&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
      &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"&gt;&lt;/script&gt;
      &lt;script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
  
    &lt;body&gt;
      &lt;div class="container-fluid"&gt;
        &lt;div class="row"&gt;
          &lt;div class="col-lg-6"&gt;
            &lt;div class="row"&gt;
              &lt;div class="col-md-6" style="background-color:lavenderblush"&gt;
         &lt;img src="https://images.pexels.com/photos/60597/dahlia-red-blossom-bloom-60597.jpeg?auto=compress&amp;cs=tinysrgb&amp;dpr=1&amp;w=500" class="rounded" alt="flower" style="width:50%; margin-top: 10px; margin-bottom: 10px"&gt;
              &lt;/div&gt;
       &lt;div class="col-md-6" style="background-color:lavender;"&gt;
         &lt;img src="https://images.pexels.com/photos/60597/dahlia-red-blossom-bloom-60597.jpeg?auto=compress&amp;cs=tinysrgb&amp;dpr=1&amp;w=500" class="rounded" alt="flower" style="width:50%; margin-top: 10px; margin-bottom: 10px"&gt;
       &lt;/div&gt;
     &lt;/div&gt;
     &lt;div class="row"&gt;
       &lt;div class="col-md-6" style="background-color:lavender"&gt;
         &lt;img src="https://images.pexels.com/photos/60597/dahlia-red-blossom-bloom-60597.jpeg?auto=compress&amp;cs=tinysrgb&amp;dpr=1&amp;w=500" class="rounded" alt="flower" style="width:50%; margin-top: 10px; margin-bottom: 10px"&gt;
              &lt;/div&gt;
       &lt;div class="col-md-6" style="background-color:lavenderblush;"&gt;
         &lt;img src="https://images.pexels.com/photos/60597/dahlia-red-blossom-bloom-60597.jpeg?auto=compress&amp;cs=tinysrgb&amp;dpr=1&amp;w=500" class="rounded" alt="flower" style="width:50%; margin-top: 10px; margin-bottom: 10px"&gt;
       &lt;/div&gt;
     &lt;/div&gt;
   &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The 4 images align to the left top (on a large screen), what I want is to align them vertically and horizontally in the center, regardless any changes of image width or height, how can I do it? I did my search online but nothing seems to truly solve the problem. </p>