Index: taxonomy_image.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_image/taxonomy_image.module,v
retrieving revision 1.12.4.22
diff -u -p -w -r1.12.4.22 taxonomy_image.module
--- taxonomy_image.module	8 Apr 2008 15:15:42 -0000	1.12.4.22
+++ taxonomy_image.module	9 Apr 2008 10:38:23 -0000
@@ -815,6 +815,13 @@ function taxonomy_image_taxonomy($op, $t
 function taxonomy_image_delete($tid) {
   $old_path = db_result(db_query('SELECT path FROM {term_image} WHERE tid=%d', $tid));
   $how_many = db_result(db_query("SELECT COUNT(path) FROM {term_image} WHERE path='%s'", $old_path));
+
+	$taxonomy_image_path = variable_get('taxonomy_image_path', 'category_pictures');
+  if ((substr($old_path, 0, strlen($taxonomy_image_path)) !=  $taxonomy_image_path ) ) {
+  	// this file is not one of our own. don't actually delete it.
+    $file_del_ok = true;
+  }
+
   if ($how_many == 1) {
     // This is the only term using this file, so it is safe to delete it.
     $file_del_ok = file_delete($old_path);
@@ -825,7 +832,7 @@ function taxonomy_image_delete($tid) {
   }
   $db_del_ok = db_query('DELETE FROM {term_image} WHERE tid=%d', $tid);
   if ($file_del_ok && $db_del_ok) {
-    drupal_set_message(t('@name image deleted.', array('@name' => $old_path)));
+    drupal_set_message(t('@name image removed.', array('@name' => $old_path)));
   }
   else {
     drupal_set_message(t('Image delete failed. File: !file, Db: !db.',
