If you want to refer to a variable in an attribute you need to use Attribute Value Templates.
Try this line instead in your template
<fo:external-graphic content-height="9mm" content-width="9mm" height="10mm" width="10mm"
scaling="non-uniform" src="url({$imgUrl})"/>
The curly braces indicate an expression to be evaluated, rather than output literally (which is what is happening to your code at the moment. It is literally outputting the text $imgUrl, rather than the value of the variable).