PDFBOX-3000: avoid ArrayIndexOutOfBoundsException, simplify output raster creation, assign rgba[3] only if within bounds