Fix Imagedisplay null pointer bug.