Automate image optimisation

(Mergeable version of #123)
You might want to document why this option is set to false, so that nobody, thinking it's there for no apparent reason, just comes and removes it.