Image optimization backport
Merge pull request #43 from Camwyn/master

Image optimization backport