title: Adjust div to image size
body: <p>normally, I used to adjust an image to a div depending of it's width and height attributes using background-image. Now I have the exactly opposite issue.</p>
  
  <p>What I'm trying to do is adjust the div size to the image but with a maximum width and height. let's say that if image is 200x200, the div must be adjusted to this size but if image exceeds the 300x300, it must by limited.</p>
  
  <p>Any idea of how should i do it?</p>