Got PDF inline display working.
Cleaned up to build media on the fly rather than templating up-front.