added deleting images after close