In the end I implemented a solution client-side, by removing the image size from the URL query string before generating the PDF.