better image cleanup