media – Image Style issue

I have created an Image style which I am applying in my Blog view.
But the Images are not generated in the Blog View Image folder and hence it is not showing up because of the path issue.
sites/default/files/blog/images/testing.jpg – This is the path where my images are getting stored.
sites/default/files/styles/test/public/blog/images/testing.jpg – This is the path generated from my view.

Adding “$config[‘image.settings’][‘allow_insecure_derivatives’] = TRUE;” in settings.php solves my issue. But I prefer not to use this because of security risks.

Also, there are no PHP errors that I can notice.

Please suggest to me how the issue can be resolved.