Avatar compatibility improvements

We can maybe have a base class or a mixin to avoid some duplication with the two classes `ProfileAvatar` and `UserAvatar`?