Building My Own Image Host

I am building my own image host on pickmy.org, when I say image host; I mean something a bit more hacked together than just putting images in a directory and turning autoindex on. But something that’s a cross between imgur and a simple self-hosted image gallery. Here’s what I’ve been able to do, where I need to go from here, and why I’m doing it this way.