Unfortunately, it’s not an ideal solution.
In my WordPress ACF settings, I made a repeater field inside a flexible content field. There is an image field inside that repeater. I’m getting the images’ data with ‘get_sub_field(‘image’)’ and put these in a gallery(royalslider).