title: object expected on jquery selector
body: <p>I am working on a function that changes the source of an image tag to a background-image. This function should be realy helpfull for the way images will look in IE. I have tried debuging, but I get stuck on an object expected error. This happens on the second line: </p>
  
  <pre><code>if ( ! Modernizr.objectfit ) {
          $('.wrapper__figure').each(function () {
              var $container = $(this),
                      imgUrl = $container.find('img').attr('src');
              if (imgUrl) {
                  $container
                      .css('backgroundImage', 'url(' + imgUrl + ')');
              }  
          });
      }
  </code></pre>
  
  <p>I realy don't know how to solve this issue. I hope you can help me.
  My regards in advance.</p>