Index: profile_pictures.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/profile_pictures/profile_pictures.module,v
retrieving revision 1.2
diff -u -p -r1.2 profile_pictures.module
--- profile_pictures.module	17 May 2010 09:02:09 -0000	1.2
+++ profile_pictures.module	17 May 2010 17:56:08 -0000
@@ -176,6 +176,8 @@ function profile_pictures_profile_alter(
     $res = db_query('SELECT * FROM {profile_fields} WHERE visibility <> %d AND visibility <> %d AND type="picture" ORDER BY category, weight', PROFILE_PRIVATE, PROFILE_HIDDEN);
   }
   while ($field = db_fetch_object($res)) {
+    if (empty($acc->{$field->name})) continue;
+
     if (!isset($cont[$field->category])) {
       $cont[$field->category] = array(
         '#type'  => 'user_profile_category',
@@ -183,8 +185,6 @@ function profile_pictures_profile_alter(
       );
     }
 
-    if (empty($acc->{$field->name})) continue;
-
     $opts = unserialize($field->options);
     // Just display image
     $cont[$field->category][$field->name] = array(
