Maybe my thoughts are naive, but why don't you use simple way to integrate 4images - phpBB? I mean, just to synchronize username/password in both databases.
Something like this:
Login at 4images > check 4images DB > found > login successful
Login at 4images > check 4images DB > not found > check phpBB DB > found > update userinfo in 4images DB > login successful
Login at 4images > check 4images DB > not found > check phpBB DB > not found > register at 4images > update userinfo in phpBB DB
and viceversa, from phpBB side ...
I think, you understand what I mean. Unfortunately, I'm not good in PHP programming enough to do it myself. If somebody can make such MOD, it should be possible to apply it even to full 4images galleries and full phpBB boards.