Define the TCPDF constant K_PATH_IMAGES to avoid a warning when open_basedir is set. Also move the require into the functions where we use the PDF library.