diff --git a/src/Plugin/ImageAPIOptimizeProcessor/PngCrush.php b/src/Plugin/ImageAPIOptimizeProcessor/PngCrush.php
index a800131..8f115f6 100644
--- a/src/Plugin/ImageAPIOptimizeProcessor/PngCrush.php
+++ b/src/Plugin/ImageAPIOptimizeProcessor/PngCrush.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\imageapi_optimize_binaries\Plugin\ImageAPIOptimizeProcessor;
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\File\FileExists;
 use Drupal\Core\File\FileSystemInterface;
 use Drupal\imageapi_optimize_binaries\ImageAPIOptimizeProcessorBinaryBase;
 
@@ -42,7 +44,7 @@ class PngCrush extends ImageAPIOptimizeProcessorBinaryBase {
         );
 
         if ($this->execShellCommand($cmd, $options, $arguments)) {
-          return (bool) \Drupal::service('file_system')->move($temp_file, $image_uri, FileSystemInterface::EXISTS_REPLACE);
+          return (bool) \Drupal::service('file_system')->move($temp_file, $image_uri, DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '10.3.0', fn() => FileExists::Replace, fn() => FileSystemInterface::EXISTS_REPLACE));
         }
       }
     }
diff --git a/src/ShellOperations.php b/src/ShellOperations.php
index b930b31..0f837f9 100644
--- a/src/ShellOperations.php
+++ b/src/ShellOperations.php
@@ -3,6 +3,8 @@
 namespace Drupal\imageapi_optimize_binaries;
 
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\File\FileExists;
 use Drupal\Core\File\FileSystemInterface;
 
 /**
@@ -66,7 +68,7 @@ class ShellOperations implements ImageAPIOptimizeShellOperationsInterface {
     $output = ob_get_contents();
     ob_end_clean();
 
-    \Drupal::service('file_system')->saveData($output, $dst, FileSystemInterface::EXISTS_REPLACE);
+    \Drupal::service('file_system')->saveData($output, $dst, DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '10.3.0', fn() => FileExists::Replace, fn() => FileSystemInterface::EXISTS_REPLACE));
 
     if ($return_val == 0) {
       return TRUE;
