Added a couple of checks and EOF
initial import: a tool to extra images from PDFs (scanned from documents)