I think a sensible way to respond to the Imgur issue would be for theymos to ask LoyceV and joker_josue to come up with a CSV file of TalkImg "fallback" links (i.e. old Imgur link -> new TalkImg link), and then modify the image proxy to make use of that file (maybe by importing it into a SQLite database, or loading it into a hash table at startup, or something).
A CSV file or SQLite database won't do, it's gotta be a dedicated database server which can scale if Bitcointalk and consequentially the image proxy server is hammered with incoming requests.
His suggestion, from what I understand is the proxy to redirect a link to another link.
And in that case, the proxy just has to know that the link X happens to point to Y. This could be a solution that would avoid messing with the DB of forum posts.
@LoyceV
I know you made a backup of all the images linked on the site, which made a total of 800k.
But, can you tell me how many images are from imgur?