Index: thickbox.module
===================================================================
--- thickbox.module	(revision 187)
+++ thickbox.module	(working copy)
@@ -154,10 +154,9 @@ function thickbox_form_alter($form_id, &
 function thickbox_field_formatter_info() {
   $formatter = array();
   if (module_exists('imagefield') && module_exists('imagecache')) {
-    $rules = _imagecache_get_presets();
-    foreach ($rules as $ruleid => $rulename) {
-      $formatters['thickbox]['. $rulename] = array(
-        'label' => 'Thickbox: '. $rulename,
+    foreach (imagecache_presets() as $preset) {
+      $formatters['thickbox]['. $preset['presetname']] = array(
+      'label' => 'Thickbox: '. $preset['presetname'],
         'field types' => array('image'),
         );
     }
@@ -174,8 +173,7 @@ function thickbox_field_formatter($field
     $file = _imagefield_file_load($item['fid']);
     if (strpos($formatter, 'thickbox][') !== false) {
       list($null, $namespace) = explode('][', $formatter, 2);
-      $rules = _imagecache_get_presets();
-      if (in_array($namespace, (array) $rules)) {
+      if ($preset = imagecache_preset_by_name($namespace)) {
         return theme('imagefield_image_imagecache_thickbox', $namespace, $field, $file['filepath'], $item['alt'], $item['title']);
       }
     }
@@ -188,7 +186,7 @@ function thickbox_field_formatter($field
 function theme_imagefield_image_imagecache_thickbox($namespace, $field, $path, $alt = '', $title = '', $attributes = NULL) {
   if (!empty($path)) {
     $attributes = drupal_attributes($attributes);
-    $imagecache_path = file_create_url(file_directory_path() .'/imagecache/'. $namespace .'/'. $path);
+    $imagecache_path = imagecache_create_url($namespace, $path);
     $image = '<img src="'. $imagecache_path .'" alt="'. check_plain($alt) .'" '. $attributes .' />';
 
     return l($image, file_create_url($path), array('title' => $title, 'class' => 'thickbox', 'rel' => $field['type_name']), NULL, NULL, FALSE, TRUE);
