title: Image doesn't resize in chrome after changing src
body: <p>I have a page with an image, and two options: Show image full browser height or witdh.
  i'm changing image src with javascript(image resizing is trough php).</p>
  
  <p>Now if ill switch from height to width - new image is smaller and everything works. But when i'll try to switch to width(new image is bigger), chrome loads new image, and changes it, but does not change image size. Image has changed - watermark that php places, changes and chrome inspertors shows that new image is actually bigger.</p>
  
  <p>Markup is like so:</p>
  
  <pre><code>&lt;div class="big-image" rel="52"&gt;
     &lt;span class="thumbnail" style="float: left;"&gt;
      &lt;img src="#IMAGE_URL#"&gt;
     &lt;/span&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>With other browsers than crhome, everything works.</p>
  
  <p>Javascript code is here:</p>
  
  <pre><code>function setViewType(type) {
      type = type || getViewType();
      Session.set('album_view_type', type);
      $('.album-type').removeClass('disabled');
      $('#album-type-'+type).addClass('disabled');
  
      if (type == 'width') {
              $('.actions').css({
                  'opacity': '0.3'
              });
      } else {
          $('.actions').css({
              'opacity': ''
          });
      }
  
      var $img = $('.big-image').find('img');
      $img.attr('src', $img.data('src_'+type));
  }
  </code></pre>
  
  <p>Okay, found a solution:</p>
  
  <pre><code>var $img = $('.big-image').find('img');
  var img = new Image();
  img.onload = function () {
      $img.attr('src', $img.data('src_'+type)).css({
          'width': this.width,
          'height': this.height
      });
  };
  img.src = $img.data('src_'+type);
  </code></pre>
  
  <p>Still open to cause of the problem.</p>