Removing Index.php when inserting graphics

I’m using Mautic 4 behind NGINX. I’m removing the index.php using a rewrite rule, but, when inserting graphics in the template editor, it automatically adds the index.php in. Each time I have graphics, I have to manually go to code and remove them before sending, else my recipients do not see the images.

Is there a way to adjust this setting within Mautic, do I have to manually remove every time, or will I have to remove my rewrite rule?