Added avatar upload logic.