Well, if you remove some of the condition from one of the "if" statements, like this (remove part in red):
Code:
else
{
if ($leader['hascustomavatar'] AND $vbulletin->options['avatarenabled'] AND ($leader['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canuseavatar'] OR $leader['adminavatar']))
{
if ($vbulletin->options['usefileavatar'])
then see if it works (save a copy or maybe copy the line as is and comment it out first, in case you want it back). That will try to show avatars even if a user has no permissions to use an avatar, or if "adminavatar" is not true, although I don't know what that is offhand. But it could be that those aren't important in your case so you might find that it works without that part of the condition. If not, then I'll try to figure it out when I get a chance (or maybe someone else will beat me to it).