The core LT provides its own captcha class in class/data/captcha/captcha.class.php, just reimplement your code while sticking to the already existing interface and it'll be ok. This part of the captcha is used during the registration process (register.php), btw.
If you're talking about the autimage plugin, it provides its own captcha code. Have a look at file pluginauthimage.class.php, there's a few methods that take care of creating and displaying the captcha. As above, if you stick to the existing interface you'll have no problems replacing the code.
It would also be nice if you shared the code