Optimize the 2.7.0 to 2.8.0 upgrade script for avatars.