Fixed avatar saving. File types are now determined when first uploaded.