I had a programming experience with libjpeg/libexif on UNIX.
It could be an command-line utility which processes data from database and modifies JPEG files.
It could be run manually from console or via a cron job.
Also the utility could maintain a table in database where it writes current modify status of each JPEG, and so if it is occasionally restarted, it could start from the right point, not from the beginning.
For further details you can contact me on skype: ssprivstorro.