I've checked it and it works nice, thanks for providing the solution.
Still, I would have two remarks:
1) Captcha image loads each time when you open topics or messages page. In our
original paid version of the Captcha add-on, authorization code is asked only after you have actually posted something. This eats less traffic and resources.
2) If you enter Captcha code improperly, it suggests to get back, and in this process, what you have posted, in some browsers may be lost.
3) It doesn't work for other miniBB add-ons ;-)
All in all, thanks again, I hope many find this suitable (still don't forget we have
another alternative to Captcha solution).