remove old image before commit