Apply patch for BufferedImage type for PNGs

Buffered image type for PNG is TYPE_CUSTOM,, and not recognized when
creating a new BufferedImage.