diff --git a/typo3/sysext/core/Classes/Resource/OnlineMedia/Processing/PreviewProcessing.php b/typo3/sysext/core/Classes/Resource/OnlineMedia/Processing/PreviewProcessing.php
index d89ff7ff25351dd82d33836fbf27803cf6454752..2be936ccae4f23aa4a2396a0414b1c1fa809c976 100644
--- a/typo3/sysext/core/Classes/Resource/OnlineMedia/Processing/PreviewProcessing.php
+++ b/typo3/sysext/core/Classes/Resource/OnlineMedia/Processing/PreviewProcessing.php
@@ -61,7 +61,7 @@ class PreviewProcessing
      */
     public function processFile(FileProcessingService $fileProcessingService, AbstractDriver $driver, ProcessedFile $processedFile, File $file, $taskType, array $configuration)
     {
-        if ($taskType !== 'Image.Preview' && $taskType !== 'Image.CropScaleMask') {
+        if ($taskType !== ProcessedFile::CONTEXT_IMAGEPREVIEW && $taskType !== ProcessedFile::CONTEXT_IMAGECROPSCALEMASK) {
             return;
         }
         // Check if processing is needed
@@ -80,7 +80,7 @@ class PreviewProcessing
         }
         $temporaryFileNameForResizedThumb = uniqid(PATH_site . 'typo3temp/var/transient/online_media_' . $file->getHashedIdentifier()) . '.jpg';
         switch ($taskType) {
-            case 'Image.Preview':
+            case ProcessedFile::CONTEXT_IMAGEPREVIEW:
                 // Merge custom configuration with default configuration
                 $configuration = array_merge(['width' => 64, 'height' => 64], $configuration);
                 $configuration['width'] = MathUtility::forceIntegerInRange($configuration['width'], 1, 1000);
@@ -88,7 +88,7 @@ class PreviewProcessing
                 $this->resizeImage($temporaryFileName, $temporaryFileNameForResizedThumb, $configuration);
                 break;
 
-            case 'Image.CropScaleMask':
+            case ProcessedFile::CONTEXT_IMAGECROPSCALEMASK:
                 $this->cropScaleImage($temporaryFileName, $temporaryFileNameForResizedThumb, $configuration);
                 break;
         }
diff --git a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
index 867c48294fb7155e7e5caba862c2c49c77bb2dc0..9a687ed0fcc705ef1a4a235d74620965e80384ad 100644
--- a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
+++ b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
@@ -1330,7 +1330,7 @@ class ContentObjectRenderer
                     }
                 }
 
-                $processedFile = $file->process('Image.CropScaleMask', $conf);
+                $processedFile = $file->process(ProcessedFile::CONTEXT_IMAGECROPSCALEMASK, $conf);
                 $JSwindowExpand = isset($conf['JSwindow.']['expand.']) ? $this->stdWrap($conf['JSwindow.']['expand'], $conf['JSwindow.']['expand.']) : $conf['JSwindow.']['expand'];
                 $offset = GeneralUtility::intExplode(',', $JSwindowExpand . ',');
                 $newWindow = isset($conf['JSwindow.']['newWindow.']) ? $this->stdWrap($conf['JSwindow.']['newWindow'], $conf['JSwindow.']['newWindow.']) : $conf['JSwindow.']['newWindow'];
diff --git a/typo3/sysext/frontend/Classes/Controller/ShowImageController.php b/typo3/sysext/frontend/Classes/Controller/ShowImageController.php
index 62748b0d80aa2e23694ddf716bc416cd3a52febd..b53b405f2505f7da7f13a5e2ad6eb550b7c5b48a 100644
--- a/typo3/sysext/frontend/Classes/Controller/ShowImageController.php
+++ b/typo3/sysext/frontend/Classes/Controller/ShowImageController.php
@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Frontend\Controller;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Core\Exception;
+use TYPO3\CMS\Core\Resource\ProcessedFile;
 use TYPO3\CMS\Core\Resource\ResourceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
@@ -182,7 +183,7 @@ EOF;
             'frame' => $this->frame,
             'crop' => $this->crop,
         ];
-        return $this->file->process('Image.CropScaleMask', $processingConfiguration);
+        return $this->file->process(ProcessedFile::CONTEXT_IMAGECROPSCALEMASK, $processingConfiguration);
     }
 
     /**