title: Put two images with captions side by side and control their height in Latex
body: <p>I want to align two images in a latex/beamer presentation. 
  They do not have the same width/height ratio and I'd like to control the overall height. </p>
  
  <p>If I don't need captions, the following works fine :</p>
  
  <pre class="lang-latex prettyprint-override"><code>\includegraphics[height=0.35\textheight]{im1.png}
  \hfill
  \includegraphics[height=0.35\textheight]{im2.png}
  
  </code></pre>
  
  <p><strong>Note here that I don't need to input the image width, and I don't want to.</strong></p>
  
  <p>But as soon as I need to put a caption, using two <code>figure</code> environments put the figures on two lines. 
  The solution would be to insert the two <code>figure</code> environments into minipages but I would then have to compute the width of the two minipages to be in accordance with the averall height I want. </p>
  
  <p>Is it possible to avoid calculating the width of the minipages?</p>