--- modules/imagecache_profiles/imagecache_profiles.module	2008-01-11 13:09:35.000000000 -0800
+++ modules/imagecache_profiles/imagecache_profiles_fixed.module	2008-03-18 17:11:41.000000000 -0700
@@ -33,7 +33,11 @@ function phptemplate_user_picture($accou
     // Display the user's photo
     if ($account->picture && file_exists($account->picture)) {
       if (isset($size)) {
-        $picture = l(theme('imagecache', $size, $account->picture), 'user/'. $account->uid, array('title' => t('View user profile.')), NULL, NULL, FALSE, TRUE);
+        if (user_access('access user profiles')) {
+          $picture = l(theme('imagecache', $size, $account->picture), 'user/'. $account->uid, array('title' => t('View user profile.')), NULL, NULL, FALSE, TRUE);
+        } else {
+          $picture = theme('imagecache', $size, $account->picture);
+        }
       } else {
         $picture = file_create_url($account->picture);
         $alt = t("@user's picture", array('@user' => $account->name ? $account->name : variable_get('anonymous', t('Anonymous'))));
@@ -154,4 +158,4 @@ function imagecache_profiles_user_admin_
   } else {
     variable_del('user_picture_imagecache_profiles_min_height');
   }
-}
\ No newline at end of file
+}
