Well I wish I knew how the gallery would be connected with that error.
The one error we have here is in registration there was an issue running a gallery plugin t add the user also to the gallery and that fix is located in post 20 http://www.photopost.com/forum/1249997-post20.html
Your error was a gallery query and my post fixed that
You can try and rebuild the gallery userinfo under gallery maintenance but I am not seeing any connection with the vb
scripting to sent an activation email from a vb
script and the gallery so its hard to suggest anything.