Fix `gr.SelectData` so that the target attribute is correctly attached, and the filedata is included in the data attribute with `gr.Gallery` (#5798)
* fix select
* add changeset
* add changeset
* restore
* refactor
* add pytest
* typo
---------
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>