I'd try adding:
if($style_array['general'] == "") { $style_array['general'] = "default"; } else { }Above:
$avatar = "{$config['FULL_URL']}/images/{$style_array['general']}/nopicture.gif";So that if the portion of the array is blank it'll be changed to default, versus always setting it to default.