Index: /extensions/BatchDownloader/include/download.inc.php
===================================================================
--- /extensions/BatchDownloader/include/download.inc.php	(revision 23322)
+++ /extensions/BatchDownloader/include/download.inc.php	(revision 23323)
@@ -173,5 +173,5 @@
   $replace = '$1
 {strip}<a class="removeSet" href="{$U_VIEW}&amp;remove={$thumbnail.id}" data-id="{$thumbnail.id}" rel="nofollow">
-{\'Remove from download set\'|@translate}&nbsp;<img src="{$ROOT_URL}{$BATCH_DOWNLOAD_PATH}template/image_delete.png" title="{\'Remove from download set\'|@translate}">
+{\'Remove from download set\'|@translate}&nbsp;<img src="{$ROOT_URL}{$BATCH_DOWNLOAD_PATH}template/images/image_delete.png" title="{\'Remove from download set\'|@translate}">
 </a>{/strip}';
 
Index: /extensions/BatchDownloader/include/events.inc.php
===================================================================
--- /extensions/BatchDownloader/include/events.inc.php	(revision 23322)
+++ /extensions/BatchDownloader/include/events.inc.php	(revision 23323)
@@ -279,3 +279,31 @@
 }
 
+/* ajax request to remove an image */
+function batch_downloader_remove_image()
+{
+  if (!isset($_POST['action']) || $_POST['action']!='bd_remove_image') return;
+  
+  check_status(ACCESS_CLASSIC);
+
+  if (isset($_POST['set_id']) and isset($_POST['toggle_id']))
+  {
+    try
+    {
+      $BatchDownloader = new BatchDownloader($_POST['set_id']);
+      $BatchDownloader->removeImages(array($_POST['toggle_id']));
+      echo 'ok';
+    }
+    catch (Exception $e)
+    {
+      echo 'error';
+    }
+  }
+  else
+  {
+    echo 'error';
+  }
+  
+  exit(0);
+}
+
 ?>
Index: /extensions/BatchDownloader/main.inc.php
===================================================================
--- /extensions/BatchDownloader/main.inc.php	(revision 23322)
+++ /extensions/BatchDownloader/main.inc.php	(revision 23323)
@@ -32,4 +32,6 @@
 else
 {
+  add_event_handler('init', 'batch_downloader_remove_image');
+  
   add_event_handler('loc_end_section_init', 'batch_download_section_init');
   add_event_handler('loc_end_index', 'batch_download_page');
Index: tensions/BatchDownloader/remove_image.php
===================================================================
--- /extensions/BatchDownloader/remove_image.php	(revision 23322)
+++ 	(revision )
@@ -1,25 +1,0 @@
-<?php
-define('PHPWG_ROOT_PATH', '../../');
-include(PHPWG_ROOT_PATH.'include/common.inc.php');
-
-check_status(ACCESS_CLASSIC);
-
-if (isset($_POST['set_id']) and isset($_POST['toggle_id']))
-{
-  try
-  {
-    $BatchDownloader = new BatchDownloader($_POST['set_id']);
-    $BatchDownloader->removeImages(array($_POST['toggle_id']));
-    echo "false";
-  }
-  catch (Exception $e)
-  {
-    echo 'error';
-  }
-}
-else
-{
-  echo 'error';
-}
-
-?>
Index: /extensions/BatchDownloader/template/thumbnails_css_js.tpl
===================================================================
--- /extensions/BatchDownloader/template/thumbnails_css_js.tpl	(revision 23322)
+++ /extensions/BatchDownloader/template/thumbnails_css_js.tpl	(revision 23323)
@@ -12,13 +12,21 @@
   jQuery.ajax({ldelim}
     type: "POST",
-    url: "{$ROOT_URL}{$BATCH_DOWNLOAD_PATH}remove_image.php",
-    data: {ldelim} "set_id": "{$SET_ID}", "toggle_id": toggle_id }
-  }).done(function(msg) {ldelim}
-    if (msg == "false") {ldelim}
-      $trigger.parent("li").hide("fast", function() {ldelim} $trigger.remove() });
-      jQuery(".nbImagesSet").html(parseInt(jQuery(".nbImagesSet").html()) -1);
-      
-      if (typeof GThumb == "object") GThumb.build();
-    } else {ldelim}
+    url: "{$ROOT_URL}index.php",
+    data: {ldelim}
+      action: "bd_remove_image",
+      set_id: "{$SET_ID}",
+      toggle_id: toggle_id
+    },
+    success: function(msg) {ldelim}
+      if (msg == "ok") {ldelim}
+        $trigger.parent("li").hide("fast", function() {ldelim} $trigger.remove() });
+        jQuery(".nbImagesSet").html(parseInt(jQuery(".nbImagesSet").html()) -1);
+        
+        if (typeof GThumb == "object") GThumb.build();
+      } else {ldelim}
+        $trigger.html('{'Un unknown error occured'|@translate}');
+      }
+    },
+    error: function() {ldelim}
       $trigger.html('{'Un unknown error occured'|@translate}');
     }
