private static int createPNG(StdImage image, List<byte[]> imageData, List<Integer> imageType, int type, int dpi) throws IOException {
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		if (!StdImage.writePNG(baos, image, dpi)) {
			throw new IOException(UNABLE_TO_CREATE_PNG);
		}
		byte[] bytes = baos.toByteArray();
		imageData.add(bytes);
		imageType.add(Integer.valueOf(type));
		return 8 + bytes.length;
	}