clear image data after invalid input