If you can not logout in the gallery then your cookies are not set properly
Both vbulletin and Photopost should be set like this
cookie path /
cookie prefix bb
cookie domain .domain.com
then if you logout your cookies will match and you will be logged out
also remember if you change cookies in your setup you want to flush cookies from your browser to do a proper test.