title: Resize bootstrap div to fit content
body: <p>I am using twitter bootstrap to make 2 divs placed side-by-side. Each div has medium and large images inside it, arranged using jquery <strong>isotope</strong>.
  The problem is that when there are not enough images in a div, the div width remains same and there's a lot of extra space left. Like this :
  <img src="https://i.stack.imgur.com/YEBzA.png" alt="enter image description here"></p>
  
  <p>I want the divs to align centrally and also reduce in width to fit the images inside it. Like this:
  <img src="https://i.stack.imgur.com/XZ7uC.png" alt="enter image description here"></p>
  
  <p>My HTML code is this :</p>
  
  <pre><code>&lt;div id="container" class="container-fluid"&gt;
      &lt;div class="row-fluid"&gt;
          &lt;div class="legend span8"&gt;Section1&lt;/div&gt;
          &lt;div class="legend span4"&gt;Section2&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="row-fluid"&gt;
          &lt;div id="section1" class="span8"&gt;
              &lt;div class="small"&gt;&lt;img src="images/1.jpg" /&gt;&lt;/div&gt;
              &lt;div class="small"&gt;&lt;img src="images/2.jpg" /&gt;&lt;/div&gt;
              &lt;div class="big"&gt;&lt;img src="images/3.jpg" /&gt;&lt;/div&gt;
          &lt;/div&gt;
          &lt;div id="section2" class="span4"&gt;
              &lt;div class="small"&gt;&lt;img src="images/1.jpg" /&gt;&lt;/div&gt;
              &lt;div class="small"&gt;&lt;img src="images/2.jpg" /&gt;&lt;/div&gt;
              &lt;div class="big"&gt;&lt;img src="images/3.jpg" /&gt;&lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My CSS looks like this :</p>
  
  <pre><code>#section1 .small{
      width:150px;
      height:200px;
      overflow:hidden;
  }
  #section1 .big{
      width:320px;
      height:420px;
      overflow:hidden;
  }
  #section2 .small{
      width:80px;
      height:100px;
      overflow:hidden;
  }
  #section2 .big{
      width:170px;
      height:220px;
      overflow:hidden;
  }
  </code></pre>
  
  <p>Other styles are bootstrap's.</p>