diff --git a/src/Controller/Redirect.php b/src/Controller/Redirect.php
index f0f4ca7..a755211 100644
--- a/src/Controller/Redirect.php
+++ b/src/Controller/Redirect.php
@@ -22,12 +22,11 @@ class Redirect extends ControllerBase {
     $image_uri = $scheme . '://' . $target;
 
     // Get request parameters.
-    $file = $request->get('file');
     $dpr = $request->get('dpr') ? (int) $request->get('dpr') : 1;
     $width = (int) $request->get('width');
 
     // Get corresponding image style redirect url.
-    $image_style_url = \Drupal::service('client_hints')->getImageRedirectUrl($file, $dpr, $width);
+    $image_style_url = \Drupal::service('client_hints')->getImageRedirectUrl($image_uri, $dpr, $width);
 
     // Add cacheability metadata.
     $response = new CacheableRedirectResponse($image_style_url);
diff --git a/src/Service/ClientHints.php b/src/Service/ClientHints.php
index 415abb4..1611566 100644
--- a/src/Service/ClientHints.php
+++ b/src/Service/ClientHints.php
@@ -46,14 +46,12 @@ class ClientHints {
    *
    * @return \Drupal\Core\GeneratedUrl|string
    */
-  public function getImageRedirectUrl($url, $dpr = 1, $width) {
+  public function getImageRedirectUrl($uri, $dpr, $width) {
 
     $image_style_id = $this->getAppropriateImageStyleId($width * $dpr);
 
     $image_style = $this->entityManager->getStorage('image_style')->load($image_style_id);
 
-    $uri = $this->getImageUri($url);
-
     /** @var $image_style \Drupal\image\Entity\ImageStyle */
     return $image_style->buildUrl($uri);
 
@@ -147,26 +145,4 @@ class ClientHints {
 
   }
 
-  /**
-   * @param $image_url
-   *
-   * @return string
-   */
-  public function getImageUri($image_url): string {
-
-    $default_scheme = file_default_scheme();
-    $default_stream_wrapper = \Drupal::service('stream_wrapper_manager')
-      ->getViaScheme($default_scheme);
-
-    if ($default_stream_wrapper instanceof LocalStream) {
-      $streamwrapper = $default_stream_wrapper->getUri();
-    } else {
-      $streamwrapper = $default_stream_wrapper->dirname();
-    }
-
-    $uri = str_replace($default_stream_wrapper->getDirectoryPath(), '', $streamwrapper . $image_url);
-    return $uri;
-
-  }
-
 }
