Yes I know the problem is only on your gallery. The issue is in how vbulletin has relative urls in there code. The error script or standard_error templates as I beleive they are called are used for the required login and however that script is done in vbulletin has a relative url to there css.php script thats your issue. Basically requiring login before anyone can see anything uses that special
vb login page which runs before any replacement or anything can be done. Maybe turn on in your
vb settings the baseurl thing to yes?