diff --git a/dummyimage.module b/dummyimage.module
index b451237..fa3c818 100644
--- a/dummyimage.module
+++ b/dummyimage.module
@@ -117,7 +117,7 @@ function dummyimage_preprocess_image(&$variables) {
       // Reconstruct the original uri to check if it exist.
       $path_parts = explode('/', strstr($variables['path'], '/styles/' . $variables['style_name']), 5);
       $original_uri = strtok($path_parts[3] . '://' . $path_parts[4], '?');
-      if (is_file($original_uri)) {
+      if (file_exists(urldecode($original_uri))) {
         break;
       }
     case DUMMYIMAGE_GENERATE_ALL:
