terminate subprocess after loading image