Gamen:
looks like Gelbooru was using the sha-1 hash of the original filename
Actually this is not - I've studied the engine's code. Upload is handled by classes/image.class which contains stuff like
$filename = hash('sha1',hash('md5',$url)); all around.
And it's the same with password hashes, btw - they're generated from SHA-1 of MD5 of the password string. I guess it's the approach "the more hashing the better stuff", lol.