To trigger the flow based on a gallery selected item, you can write the formula on the "OnSelect" property of the Gallery control.
Also, please make sure that OnSelect property of all the controls inside this gallery has the expression: Select(Parent). This will be good for user experience.
Hope this Helps!
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!