itext5: Allow PDF resources as background image

This patch just applies the fix to ITextUserAgent from flyingsaucerproject/flyingsaucer#51 to the corresponding itext5 version.