Patch the Pdf class addImage method