Merge pull request #14 from lordastley/master

Broke image processing out into functions.
Fixed most thumbnailing issues, with an RGB conversion.
And fixed average color detection, also with an RGB conversion.