CAPTCHA with images of objects
Performance

You didn't post the mysqli_get_value code, but I would assume that it interacts with the database. Is this call really necessary? You don't seem to use the result. But if you do need it somewhere else: couldn't you just retrieve the id in the initial query?

Have you tried storing the path to an image in the database instead of storing the whole image? 

As to your main query: ORDER BY RAND() is quite slow. Check out this question for faster solutions to select random rows from a big table. If you google for mysql select random values from table you should find a lot more results as well (for example here). 

Also, do captcha_images and captcha_objects really need to be different tables? I don't know your whole db schema, but it seems that it could all go into the same table, thus saving you a join.

Misc


a line length of 323 characters is way too long, it will not fit on any screen. I would aim for 80 (maybe 120).
use curly braces, even for one-line statements (for readability and to prevent bugs).
use spaces around . (I think that it really helps with readability).