Support PDF images in PDF output, PNG otherwise

[Delivers #62668410]
Issue pull request for branch 62668410-pdf-png

[Delivers #62668410](https://www.pivotaltracker.com/story/show/62668410)
[Delivers #62358298](https://www.pivotaltracker.com/story/show/62358298)
[Delivers #62352812](https://www.pivotaltracker.com/story/show/62352812)
Merge branch 'stable' into 62668410-pdf-png
[#62668410]

* 62668410-pdf-png:
  Issue pull request for branch 62668410-pdf-png
  Support PDF images in PDF output, PNG otherwise