I have the same problem and tried solving this with your update of the php file.
And somehow it now only opens images in a different page.. so no lightbox..

So now I solved the lightbox coming up but not displaying pics.. with no lightbox at all

heheh
anyone has got any clue about how to solve this correctly?
Im not a php magician unfortunately
I read somewhere that it could be a different javascript ruining the cbgallery script..
i have
joomla 1.5
CB 1.2 Rc 2
i have disabled some other plugins on my site like 'Simple Image Gallery' to see if that influenced the display of the CB gallery, but no luck unfortunately.
Please gimme some help about what it could be.
I hope to be able to launch my site A.S.A.P. but would like to have it completely working correctly
THANKS!!