updated JPEG writing to java 7