What's the explanation for "thumb/5/54" in the example above? Are there rules for conversion?
It's based on the MD5 hash of the image name. The MD5 Hash of "150px-Flag_de-berlin_civil_300px.png" is 5490af54dffb956a9455f50a1f954eee. The first folder is the first character, and the sub-folder is the first 2 characters.