Index: imagecache_profiles.module
===================================================================
--- imagecache_profiles.module	(revision 377)
+++ imagecache_profiles.module	(working copy)
@@ -58,7 +58,7 @@ function imagecache_profiles_preprocess_
 
     if (isset($picture)) {
       $alt = t("@user's picture", array('@user' => $account->name ? $account->name : variable_get('anonymous', t('Anonymous'))));
-      $preset = imagecache_preset($size);
+      $preset = imagecache_preset_by_name($size);
       if (empty($preset)) {
         $variables['picture'] = $default;//theme('image', $picture, $alt, $alt, '', FALSE);
       } else {
@@ -86,7 +86,7 @@ function imagecache_profiles_form_alter(
       $presets = array();
       $presets[] = '';
       foreach (imagecache_presets() as $key => $preset) {
-        $presets[$key] = check_plain($preset['presetname']);
+        $presets[check_plain($preset['presetname'])] = check_plain($preset['presetname']);
       }
 
       $form['pictures']['settings']['user_picture_imagecache_profiles'] = array(
Index: imagecache_profiles.install
===================================================================
--- imagecache_profiles.install	(revision 377)
+++ imagecache_profiles.install	(working copy)
@@ -64,3 +64,32 @@ function imagecache_profiles_uninstall()
     variable_del($var);
   }
 }
+
+/**
+ * Switch stored preset ID to preset name.
+ */
+function imagecache_profiles_update_6001() {
+  $ret = array();
+
+  $conf = array(
+    'user_picture_imagecache_profiles',
+    'user_picture_imagecache_comments',
+    'user_picture_imagecache_profiles_default',
+  );
+
+  foreach ($conf as $name) {
+    if ($preset_id = variable_get($name, FALSE)) {
+      $preset = imagecache_preset($preset_id);
+      if ($preset['presetname']) {
+        variable_set($name, $preset['presetname']);
+      }
+    }
+  }
+
+  $ret[] = array(
+    'success' => TRUE,
+    'query' => t('Updated Imagecache Profile variable storage from ID to preset name.'),
+  );
+
+  return $ret;
+}
\ No newline at end of file
