--- img_assist.module.orig	2006-08-02 09:49:44.000000000 +0200
+++ img_assist.module	2006-08-02 09:50:39.000000000 +0200
@@ -140,8 +140,7 @@ function img_assist_block($op = 'list', 
       case 0:
         /* Since blocks aren't passed node objects (which makes sense) we need
            to determine if we are viewing a node and grab its nid */
-        $uri = parse_url(request_uri());
-        $nid = array_pop(explode('/', $uri['path']));
+        $nid = arg(1);
         if ($nid > 0) {
           $block['subject'] = t('This image appears in...');
           $block['content'] = img_assist_get_references($nid);
@@ -1356,7 +1355,7 @@ function img_assist_map_image_delete($no
  */
 function img_assist_map_load($nid) {
   $imagemap = array();
-  $result = db_query('SELECT * FROM {files} f INNER JOIN {img_assist_map} i ON f.fid = i.iid WHERE f.nid = %d', $nid);
+  $result = db_query('SELECT * FROM {files} f INNER JOIN {img_assist_map} i ON f.nid = i.iid WHERE f.nid = %d', $nid);
   while ($data = db_fetch_object($result)) {
     $imagemap[] = $data->nid;
   }
@@ -1648,4 +1647,4 @@ function theme_img_assist_legacy() {
 	return "<div class=\"%image-class\">\n  <a href=\"%node-link\"><img src=\"%src\" width=\"%width\" height=\"%height\" alt=\"%alt\" /></a>\n  <div class=\"caption\">%caption</div>\n</div>";
 }
 
-?>
\ No newline at end of file
+?>
