Windows compatibility

Merged code with the one by Ian.
Refactored it for cross plattform compatibility.
Performance fix in Ians code: Publish images only when someone is interested.
Updated compiling instructions for ubuntu
Created compiling instructions for windows