Describe the bug
After creating a gallery block and uploading an image to it – via drag & drop or the upload button – all images of the media library are displayed as selected in the edit gallery view. I am using Gutenberg 3.5.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Just the images from the gallery should be set as selected.
Screenshots

Desktop (please complete the following information):
Good find! Tested and confirmed with WordPress 4.9.8 and Gutenberg 3.6.2 using Firefox 61.0.2 and Chrome 68.0.3440.106 on macOS 10.13.6. (1m29s)

This is still happening today. I was able to reproduce this just now. 👍
Just yesterday I was also able to reproduce the same issue.
Btw I received some feedback in the Slack #design channel:
"There was a discussion in my local meetup channel about galleries and a friend created this video to illustrated the challenges he was having using the gallery block."
https://www.useloom.com/share/71a4e0dc1f064f5f92392a28ca23610c
Btw - An update for GB version 5.0 Rc-1
Uploading media: Still having the same gallery block selected click the pencil icon. All the images in the media library shows up. I clicked cancel. Deselected the gallery block and then selected it again. Then only 4 images showed up in the Edit Gallery view.
I started digging into this. Wanted to document some of my initial findings as I find a solution.
I'm noticing we check for images.length to render the edit toolbar. Then we set the value of the edit button to images.map( ( img ) => img.id )
src:
https://github.com/WordPress/gutenberg/blob/d9b232d1d15db418d22db89c53626542a8efd654/packages/block-library/src/gallery/edit.js#L198-L216
The images object updates as each photo dropped is uploaded. I'm thinking that the initial value is mapping through an empty images attribute and is holding that value. To test this I added a log right after the condition. You'll notice that the object starts as a blank array, then starts filling in the ids as they upload. I think that when the array is initially set, it passes the images.length check and assigns the value field to a blank array. For whatever reason, the value field of the MediaUpload component is not updating with the updates to the images attribute. Going to continue investigating. :)

this is invalid now as that button has been removed;
Most helpful comment
I started digging into this. Wanted to document some of my initial findings as I find a solution.
I'm noticing we check for
images.lengthto render the edit toolbar. Then we set the value of the edit button toimages.map( ( img ) => img.id )src:
https://github.com/WordPress/gutenberg/blob/d9b232d1d15db418d22db89c53626542a8efd654/packages/block-library/src/gallery/edit.js#L198-L216
The images object updates as each photo dropped is uploaded. I'm thinking that the initial
valueis mapping through an emptyimagesattribute and is holding that value. To test this I added a log right after the condition. You'll notice that the object starts as a blank array, then starts filling in the ids as they upload. I think that when the array is initially set, it passes theimages.lengthcheck and assigns thevaluefield to a blank array. For whatever reason, the value field of theMediaUploadcomponent is not updating with the updates to theimagesattribute. Going to continue investigating. :)