Only store the basename of the uploaded file
Fixed ordering problem
Using encode() on unicode strings