diff --git a/src/Form/SettingsForm.php b/src/Form/SettingsForm.php
index 23fe541..5a7290e 100644
--- a/src/Form/SettingsForm.php
+++ b/src/Form/SettingsForm.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\wpf\Form;
 
+use Drupal\Component\Utility\DeprecationHelper;
 use Drupal\Core\Form\ConfigFormBase;
 use Drupal\Core\Form\FormStateInterface;
 
@@ -43,7 +44,7 @@ class SettingsForm extends ConfigFormBase {
     $form['styles']['disabled'] = [
       '#type' => 'checkboxes',
       '#title' => $this->t('Disable fallback image for styles'),
-      '#options' => image_style_options(FALSE),
+      '#options' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.4.0', fn() => \Drupal::service('Drupal\image\ImageDerivativeUtilities')->styleOptions(FALSE), fn() => image_style_options(FALSE)),
       '#default_value' => $settings->get('styles.disabled') ?? [],
     ];
 
diff --git a/src/Hook/WpfHooks.php b/src/Hook/WpfHooks.php
new file mode 100644
index 0000000..3bfb2b5
--- /dev/null
+++ b/src/Hook/WpfHooks.php
@@ -0,0 +1,45 @@
+<?php
+
+namespace Drupal\wpf\Hook;
+
+use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Hook\Attribute\Hook;
+/**
+ * Hook implementations for wpf.
+ */
+class WpfHooks
+{
+    /**
+     * Implements hook_preprocess_responsive_image().
+     */
+    #[Hook('preprocess_responsive_image')]
+    public static function preprocessResponsiveImage(&$variables): void
+    {
+        $uri = $variables['img_element']['#uri'] ?? '';
+        $variables['img_element']['#uri'] = \Drupal::service('wpf.image_factory')->getJpg($uri);
+    }
+    /**
+     * Implements hook_crop_insert().
+     */
+    #[Hook('crop_insert')]
+    public static function cropInsert($entity)
+    {
+        \Drupal::service('wpf.image_factory')->invalidateFallbackImagesByCrop($entity);
+    }
+    /**
+     * Implements hook_crop_update().
+     */
+    #[Hook('crop_update')]
+    public static function cropUpdate($entity)
+    {
+        \Drupal::service('wpf.image_factory')->invalidateFallbackImagesByCrop($entity);
+    }
+    /**
+     * Implements hook_file_delete().
+     */
+    #[Hook('file_delete')]
+    public static function fileDelete(\Drupal\Core\Entity\EntityInterface $entity): void
+    {
+        \Drupal::service('wpf.image_factory')->fileDelete($entity);
+    }
+}
diff --git a/wpf.info.yml b/wpf.info.yml
index a34fcc1..b4b3da9 100644
--- a/wpf.info.yml
+++ b/wpf.info.yml
@@ -2,7 +2,7 @@ name: Webp fallback image
 type: module
 description: Prepare fallback image for webp using responsive image.
 package: Image
-core_version_requirement: ^10.3 || ^11
+core_version_requirement: ^10.3 || ^11 || ^12
 dependencies:
   - drupal:file
   - drupal:responsive_image
diff --git a/wpf.module b/wpf.module
index 991fdfd..4902e19 100644
--- a/wpf.module
+++ b/wpf.module
@@ -8,37 +8,39 @@
  * This file is no longer required in Drupal 8.
  * @see https://www.drupal.org/node/2217931
  */
-
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\wpf\Hook\WpfHooks;
 use Drupal\Core\Entity\EntityInterface;
 
 /**
  * Implements hook_preprocess_responsive_image().
  */
-function wpf_preprocess_responsive_image(&$variables): void {
-  $uri = $variables['img_element']['#uri'] ?? '';
-  $variables['img_element']['#uri'] = \Drupal::service('wpf.image_factory')
-    ->getJpg($uri);
+#[LegacyHook]
+function wpf_preprocess_responsive_image(&$variables): void
+{
+    \Drupal::service(WpfHooks::class)->preprocessResponsiveImage($variables);
 }
 
 /**
  * Implements hook_crop_insert().
  */
+#[LegacyHook]
 function wpf_crop_insert($entity) {
-  \Drupal::service('wpf.image_factory')
-    ->invalidateFallbackImagesByCrop($entity);
+  \Drupal::service(WpfHooks::class)->cropInsert($entity);
 }
 
 /**
  * Implements hook_crop_update().
  */
+#[LegacyHook]
 function wpf_crop_update($entity) {
-  \Drupal::service('wpf.image_factory')
-    ->invalidateFallbackImagesByCrop($entity);
+  \Drupal::service(WpfHooks::class)->cropUpdate($entity);
 }
 
 /**
  * Implements hook_file_delete().
  */
+#[LegacyHook]
 function wpf_file_delete(EntityInterface $entity): void {
-  \Drupal::service('wpf.image_factory')->fileDelete($entity);
+  \Drupal::service(WpfHooks::class)->fileDelete($entity);
 }
diff --git a/wpf.services.yml b/wpf.services.yml
index fed23eb..8034c49 100644
--- a/wpf.services.yml
+++ b/wpf.services.yml
@@ -14,3 +14,7 @@ services:
       - '@entity_type.manager'
       - '@file_system'
       - '@file.mime_type.guesser'
+
+  Drupal\wpf\Hook\WpfHooks:
+    class: Drupal\wpf\Hook\WpfHooks
+    autowire: true
