Index: path_image.module
===================================================================
--- path_image.module	(revision 24)
+++ path_image.module	(working copy)
@@ -302,12 +302,7 @@
  */
 function _path_image_file_exists($params = array()) {
 
-  return file_exists(
-    $_SERVER['DOCUMENT_ROOT'] . '/' . 
-    file_directory_path() . '/' .
-    $params['image_repos'] . '/' . 
-    $params['image_file']
-  );
+  return file_exists(file_create_path(variable_get('path_image_repository', 'images')) . $params['image_file']);
 }
 
 /**
@@ -623,10 +618,8 @@
   
   $file_types = variable_get('path_image_file_types', array('gif', 'jpg', 'png'));
   
-  $dir = $_SERVER['DOCUMENT_ROOT'] . '/' . 
-         file_directory_path() . '/' . 
-         variable_get('path_image_repository', 'images');
-         
+  $dir = file_create_path(variable_get('path_image_repository', 'images'));
+  
   if (is_dir($dir)) {
     if ($dh = opendir($dir)) {
       while (($file = readdir($dh)) !== false) {
