Improve diagram resolution and orientation

* Set diagrams at 300dpi
* Specify maximum image size to A4 dimensions
* Use landscape orientation when needed