--- image.php.orig	2015-11-06 10:33:51.397868400 +0200
+++ image.php	2015-11-06 11:11:34.587096164 +0200
@@ -194,7 +194,9 @@
 	}
 
 	// Remove the blob of binary data from the array.
-	unset( $metadata['image']['data'] );
+	if ( $metadata ) {
+		unset( $metadata['image']['data'] );
+	}
 
 	/**
 	 * Filter the generated attachment meta data.
