Took a look at the plugin.
// Construct new hidden span for the image
var newSlide = this.$imageContainer
.append('<span class="image-wrapper current"><a class="advance-link" rel="history" href="#'+this.data[nextIndex].hash+'" title="'+imageData.title+'"> </a></span>')
.find('span.current').css('opacity', '0');
newSlide.find('a')
.append(imageData.image)
.click(function(e) {
gallery.clickHandler(e, this);
});
You'll notice that it first constructs the string you're talking about, then it appends the imageData into the anchor. The result is that the
tag is never replaced. You could try simply changing that .append(imageData.image)
to .html(imageData.image)
and seeing if that doesn't fix your issue.