JVM Hangs after creating planar image