diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php
index b7e878f2e7e3111fa499741180439607d5ce2283..d043c64f853dda9f4ca7e98d40dbadf901614271 100644
--- a/apps/theming/lib/Controller/ThemingController.php
+++ b/apps/theming/lib/Controller/ThemingController.php
@@ -280,8 +280,7 @@ class ThemingController extends Controller {
 			);
 		}
 
-		$resizeKeys = ['background'];
-		if (in_array($key, $resizeKeys, true)) {
+		if ($key === 'background' && strpos($detectedMimeType, 'image/svg') === false) {
 			// Optimize the image since some people may upload images that will be
 			// either to big or are not progressive rendering.
 			$newImage = @imagecreatefromstring(file_get_contents($image['tmp_name'], 'r'));