diff --git a/stage_file_proxy.module b/stage_file_proxy.module
index 64b74d5..67af034 100644
--- a/stage_file_proxy.module
+++ b/stage_file_proxy.module
@@ -14,7 +14,7 @@ function stage_file_proxy_init() {
   if ($server) {
     // is this an imagecache request? if so, request only the root file and let imagecache handle resizing
     if (variable_get('stage_file_proxy_use_imagecache_root', TRUE) && strpos($relative_path, 'imagecache') === 0) {
-      $relative_path = preg_replace('/imagecache\/.*\/(.*)/U', '$1', $relative_path);
+      $relative_path = preg_replace('/^.+\/imagecache\/.*\/(.*)/U', '$1', $relative_path);
       // This image could be in the files directory, or elsewhere in our
       // codebase. @see imagecache_create_path().
       if (file_exists($file_dir . '/' . $relative_path) || file_exists($relative_path)) {
