I'm not too familiar with XenForo, but they seem to have a sort of "plugin" system that you can use to disable things like this without having to edit the actual template files.
https://xenforo.com/community/resources/allow-user-to-hide-avatars.7174/
Here is one such plugin that seems to do...