optimize detecting avatar image logic
Merge pull request #2930 from techAPJ/patch-2

optimize detecting avatar image logic