Thank you very much for your reply, but I still didn't solve my problem.
I'll try to explain it better:
For example, I have 3 figures in Chapter 5. The figures will have reference numbers: 5.1, 5.2, and 5.3. But, if I refer to the first image in a subsection 5.1.3, in the text I will get the reference number 5.1.3 not 5.1. If I refer to the same figure but in a subsection 5.2.2 the text will contain the figure number 5.2.2.
Hope this will look more clear to you.