More than 150 pilot whales have been saved from stranding on a beach in Western Australia's southwest however 31 have died.