Few updates, fix uploadAvatar for empty file.