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