diff --git a/flysystem_s3.module b/flysystem_s3.module
new file mode 100644
index 0000000..19d75c2
--- /dev/null
+++ b/flysystem_s3.module
@@ -0,0 +1,19 @@
+<?php
+
+/**
+ * @file
+ * Contains Flysystem S3 functionality.
+ */
+
+/**
+ * Implements hook_image_style_flush().
+ */
+function flysystem_s3_image_style_flush($style) {
+  $directory = 'styles/' . $style->id();
+  /** @var \League\Flysystem\Filesystem $filesystem */
+  $filesystem = \Drupal::service('flysystem_factory')->getFilesystem('s3');
+  $adaptor = $filesystem->getAdapter();
+  if ($adaptor->has($directory)) {
+    return $adaptor->deleteDir($directory);
+  }
+}
