I am trying to insert an image in my pandoc document for the first time and have this code:

When I run this through pandoc I get the error
Error producing PDF.
! Undefined control sequence.
\grffile@org@Ginclude@graphics ... \set@curr@file
{#1}\edef \uq@curr@file {\...
l.215 ...bb895ffd5f684410677618f069f8ceb54436.jpg}
I have tried adding \usepackage{graphicx} to my header-includes but this makes no difference. What am I missing here?