Convert uploaded PDF cover to thumbnail PNG

When PDFs were uploaded the first page is converted to a PNG and sized
to a thumbnail. Solution is still a problem. The thumbnail name ends
with .pdf even though it's a .png. Browsers correctly show the image but
the content type is wrong.
PDF thumbnail preview