Fix image sizes pdf. Fixes #250

The images will be shown in the appropriate positions.

Will close #250

Needs to be re-checked after merging #348