Code cleaning for avatar upload