How to add event on the next and back button of gallery component on which image changes in vFlow?

I am using one gallery component and a FV component below it and I want when I change the image in the gallery component on the click of next and back button the FV component’s data should also get changes simultaneously. How can I achieve this functionality?