fixed dead-locking bug
use Toolkit instead of ImageIO