var img = $('<img id="link-image" />').attr('src', s3Link)
        .on('load', function () {
            if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) {
                img.attr('src', getErrorImage());
                $("#image-wrapper").html(img);