Finish avatar upload function.