The documentation on how to delete an image is incorrect.
Deleting an image should be:
$image->delete()
The docs currently show an example of how to retrieve an image. Someone reading it might assume that you can just replace the getImage function call shown there with deleteImage but that would be incorrect.