Image updating, program no longer properly closes