Detecting blank image files
Use the identify feature of ImageMagik CLI as given here:
http://www.imagemagick.org/script/identify.php
With command:
$ identify -format "%#" source.png
If the number of colors is 1, you have a blank page.
You can also use the command:
identify -verbose source.png
The standard deviation, skew and kurtosis will be 0 for a blank image.