In general the advice when you have a strange error is to upgrade, not stop upgrading.
Could the avatars you’ve added be missing from wherever you’re loading them from?
It sounds like perhaps the avatars got moved out of the uploads directory. You could look for the missing ones under /var/discourse/shared/standalone/uploads something like
find /var/discourse/shared/standalone/uploads -name filename-of-image.jpg