cairo: Do not set an invalid matrix in drawImage()

https://bugs.freedesktop.org/show_bug.cgi?id=70085
Return empty if getXRef()->copy() fails

Seems this can happen by looking at the backtrace in https://bugs.kde.org/show_bug.cgi?id=325810
Merge remote-tracking branch 'origin/poppler-0.24'
Allow only one %d in the filename

Fixes crashes if you had %s and similar in the filename

Inspired from patch by Pedro Ribeiro <pedrib@gmail.com>

Bug #69434
Merge remote-tracking branch 'origin/poppler-0.24'