Don't forget to "empty trash" afterwards, as deleted images all end up in the trash for something like 30 days. The script docs seem to neglect that point.
When I had to delete a few hundred gigabytes of photos, emptying the trash was just as flaky as deleting the photos was, repeatedly timing out and throwing errors.
Don’t forget to delete your Google account after deleting your photos.