What I did:
- Insert > Gallery in 2017WTE
- Add two copies of the same image (double-clicked?)
- Delete the first.
- Insert the gallery. The gallery now contains one image.
- Cut, paste, and fix the wikitext for two other images. The gallery now contains three images.
- Switch from 2017WTE to the visual editor. The gallery displays the three images correctly.
- Click on the gallery
- Be surprised to see that the box says "4 images".