In our c# application we are not using MD5 as it is not secure, we are using SHA256. but when we use SHA256 we are not getting any images from gravatar. My questions are
As MSalters already mentioned, I don't think it really matters in this use case. You're not doing anything cryptographic, so I don't think there are any issues with MD5 in this scenario. However, if you do specifically want an alternative that supports SHA-256 hashes of emails to get user avatars (though definitely not as popular as gravatar), there's Libravatar. Libravatar's API documentation does state that it supports SHA-256 for retrieving avatars.