Move images->html and images->pdf to core.

- Add a test for images->html.
Add images->pdf test.
Refactor pdf/html func to apply the appropriate extension.