Modified from Daniel Vassallo's original answer:
CSS:
.image-thumb {
position: relative;
width: 100px;
height: 100px;
/* apply background-image url inline on the element since it is part of the content */
background: transparent url() no-repeat center center;
}
.image-thumb a {
display: none;
position: absolute;
top: 80px; /* position in bottom right corner, assuming image is 16x16 */
left: 84px;
width: 16px;
height: 16px;
background: transparent url(remove_button.gif) no-repeat 0 0;
}
.image-thumb:hover a {
display: block;
}
HTML (presuming that it is generated):
<div class="image-thumb" id="some-unique-thumb-id-1" style="background-image: url(some/image-1.ext)">
<a href="#"></a>
</div>
<div class="image-thumb" id="some-unique-thumb-id-2" style="background-image: url(some/image-2.ext)">
<a href="#"></a>
</div>
....
<div class="image-thumb" id="some-unique-thumb-id-n" style="background-image: url(some/image-n.ext)">
<a href="#"></a>
</div>
JavaScript:
$(function() {
$(".image-thumb a").click(function(e) {
e.preventDefault();
var imageId = $(this).parent().attr("id");
// remove image based on ID.
});
});
Edit: simplified the HTML.