I know it’s a bit old post, but I am facing same issue at the moment and found a quick solution… .
I am hiding all elements with css using this code:
div.gallery a.cboxElement {
display: none;
}
and then using jquery to show only first element of the gallery:
$(“div.gallery”).find(“a.cboxElement:first”).css(“display”,”block”);
works perferct for me! Hope it will help others who might be facing same issue.