code: function(parent, item, callback){
      var width = parent.width();
  
      item.imagesLoaded(function(){
        var _this = this[0],
          nWidth = _this.naturalWidth,
          nHeight = _this.naturalHeight;
  
        callback();
        this.animate({opacity: 1}, 500);
        parent.animate({height: width * nHeight / nWidth}, 500);
      });
    }
docs: Gallery