Broke image processing out into functions.
Updated comment to track issue #6.
Merge pull request #14 from lordastley/master

Broke image processing out into functions.