This is very common scenario in case the number to contact resolution does not work. You need to create directory lookup rules to modify the incoming number so that it matches the number configured for the contact in question.
Here's an example
You have a contract named John Doe with a DN configured in AD as 101. The contact has an avatar.
You get an incoming call from John Doe but the incoming number is 9101.
This will result in the avatar not being displayed for a contact because number 9101 does not match the contact's configured DN.
So in summary you need to use Directory Lookup Rules and/or Application Dial Rules