generate PDF only on new image + console log improvement