Optimise image delivery.
Merge pull request #92 from gjb2048/master

Optimise image delivery.Very nicely done. A far more elegant solution than my own. Thanks for sharing. My shortcomings in PHP do show occasionally :)