417a11
diff --git a/magic/Magdir/images b/magic/Magdir/images
417a11
index e94905c..a25d292 100644
417a11
--- a/magic/Magdir/images
417a11
+++ b/magic/Magdir/images
417a11
@@ -32,17 +32,42 @@
417a11
 
417a11
 # PBMPLUS images
417a11
 # The next byte following the magic is always whitespace.
417a11
-0	search/1	P1		Netpbm PBM image text
417a11
+# strength is changed to try these patterns before "x86 boot sector"
417a11
+0	search/1	P1		
417a11
+>3	regex		=[0-9]*\ [0-9]*		Netpbm PBM image text
417a11
+>3	regex		=[0-9]+\ 		\b, size = %sx
417a11
+>>3	regex		=\ [0-9]+	\b%s
417a11
+!:strength + 45
417a11
 !:mime	image/x-portable-bitmap
417a11
-0	search/1b	P2		Netpbm PGM image text
417a11
+0	search/1	P2		
417a11
+>3	regex		=[0-9]*\ [0-9]*		Netpbm PGM image text
417a11
+>3	regex		=[0-9]+\ 		\b, size = %sx
417a11
+>>3	regex		=\ [0-9]+	\b%s
417a11
+!:strength + 45
417a11
 !:mime	image/x-portable-greymap
417a11
 0	search/1	P3		Netpbm PPM image text
417a11
+>3	regex		=[0-9]*\ [0-9]*		Netpbm PPM image text
417a11
+>3	regex		=[0-9]+\ 		\b, size = %sx
417a11
+>>3	regex		=\ [0-9]+	\b%s
417a11
+!:strength + 45
417a11
 !:mime	image/x-portable-pixmap
417a11
-0	string		P4		Netpbm PBM "rawbits" image data
417a11
+0	string		P4		
417a11
+>3	regex		=[0-9]*\ [0-9]*		Netpbm PBM "rawbits" image data
417a11
+>3	regex		=[0-9]+\ 		\b, size = %sx
417a11
+>>3	regex		=\ [0-9]+	\b%s
417a11
+!:strength + 45
417a11
 !:mime	image/x-portable-bitmap
417a11
-0	string		P5		Netpbm PGM "rawbits" image data
417a11
+0	string		P5		
417a11
+>3	regex		=[0-9]*\ [0-9]*		Netpbm PGM "rawbits" image data
417a11
+>3	regex		=[0-9]+\ 		\b, size = %sx
417a11
+>>3	regex		=\ [0-9]+	\b%s
417a11
+!:strength + 45
417a11
 !:mime	image/x-portable-greymap
417a11
-0	string		P6		Netpbm PPM "rawbits" image data
417a11
+0	string		P6		
417a11
+>3	regex		=[0-9]*\ [0-9]*		Netpbm PPM "rawbits" image data
417a11
+>3	regex		=[0-9]+\ 		\b, size = %sx
417a11
+>>3	regex		=\ [0-9]+	\b%s
417a11
+!:strength + 45
417a11
 !:mime	image/x-portable-pixmap
417a11
 0	string		P7		Netpbm PAM image file
417a11
 !:mime	image/x-portable-pixmap