The captcha generation depends on certain layout of the fonts (looks like a Mac-style to me), and certain fonts being present. And then someone has multiplied that all together to come up with the random retrieval of captchas.
This may work on the servers Lacuna is on now, but doesn't work well for copies of Lacuna installed elsewhere.
a) captcha generation should be overridable, both directories and font names.
b) captcha retrieval should use a "select random row" statement instead of hardcoding the number of variations available.
Note also that if you have to redo the captch creation because it failed the first time, all the ID's start where the old one left off, so the first number will be over 60_000, and all captcha retrievals will fail because they always create random numbers in the original range.