esto no es redundante ?:
Código PHP:
if($datos[avatar] == "") { $avatar = "" ;}
porque no intentas con esto:
Código PHP:
<?php if(datos[avatar] == ""):?>
<img src="noavatar.jpg" width="150" height="150" alt="avatar" />
<?php else:?>
<img src="<?php echo datos[avatar];?>" width="150" height="150" alt="avatar" />
<?php endif;?>