Much better.

Scans multiple pages to a pdf now, and only single pages to jpg's. I'm getting fpdf from gist so you need internet the first time you use this script. I'm caching fpdf to $HOME/.fpdf