Hello,
Thank you for contacting Rank Math support, and sorry for any inconvenience that might have been caused due to that.
Can you please head over to your Sitemap settings and ensure that you have added the field name of your image gallery under the option “Image Custom Fields”?

After doing so, please flush the sitemap cache by following the video guide: https://i.rankmath.com/pipRDp
Let us know how that goes. Looking forward to helping you on this one.
Thanks for your support.
My filed name is “gallery” and I added the name in “Image Custom Fields” And I flush the sitemap cache as you said, but it didn’t work.
Before, sitemap detected 1 image that was featured image and after I added the filed name in “Image Custom Fields”, the site map images just raised to 2 and it seems just one of the galley images are indexed.
Hello,
Thank you for your patience as we look into why gallery images are not being added to your sitemap.
We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.
Please do take a complete backup of your website before sharing the information with us.

It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:
https://wordpress.org/plugins/temporary-login-without-password/
You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):
https://wordpress.org/plugins/wp-security-audit-log/
We really look forward to helping you.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.