On a project a while ago i had to make a thickbox gallery which was accessible by clicking on the first thumbnail or a link "visit gallery". The other images were placed in a hidden div.
Because of the "visit gallery" link i had one pic double. Using the jQuery.filter(function) it's easy to remove the duplicate entries.
Just replace this line
TB_TempArray1 = $("a[@rel="+imageGroup+"]").get();
with this:
var aUrls = Array();
TB_TempArray = $("a[@rel="+imageGroup+"]").filter(function(index){
var href=$(this).attr('href');
if (jQuery.inArray(href, aUrls) === -1) {
aUrls.push(href);
return true;
} else {
return false;
}
}).get();