added cleanup for reimaging.