Thanks for the suggestion! I gave it a shot but unfortunately still get the same problem.
Here's some further information on the problem, found this while trying a few things today:
If I log in to the forums first, then access the gallery, all of the items in the gallery's navbar point to the correct place. E.g. the memberlist goes to [domain]/[forum folder]/memberlist.php.
If I log out, then access the gallery directly, the urls are incorrect. e.g. the memberlist goes to [domain]/[gallery folder]/memberlist.php
So the urls are correct when logged in to the forum first, but incorrect if I access the gallery folder directly. I suspect this is the cause of the login problem.
It seems to make no difference whether I have member.php or memberlist.php in the navbar replacements box for the admincp settings for vbgallery.