removing pipeline and loding image when closing