Unable to recognize image format every time I request

Can you please a screenshot of your Postman call? Then we can test it here.

Here are a few test BASE64 strings you can use:

All works fine for me. For example, this is the call with the PNG image in base64: