GEOT-4561 Incorrect image creation for images with type BufferedImage.TYPE_CUSTOM