Just introduced this in D7430 and noticed a slight issue that left container column of an image avatar set until we set another image avatar.
Specifically, if we had an image avatar and switched to emoji avatar the container field of the previous image avatar upload would remain set.
This wouldn't cause any issues in practice (as things are now), but the state of the DB would not be "corrected" until we subsequently set an image avatar.
In order to fix this we adjust the logic to match what we have in the final UPDATE threads... query.