I have a doubt about a situation.
If someone shows me a family picture, can I ask:
And would be ok if the answer is:
I think using "this" and "it" feel a little weird for a person, but maybe it's perfectly fine.
Saying "who is this"/"who's this" when you want to know who's in a picture is the normal thing to say. Similarly, if you were with a friend and there was someone in the distance and you wanted to know who they were, you'd generally say "who's that?"
Edit: To answer the second part of your question, people would usually not reply with "It's Mary," they'd usually reply with just "Mary," or "That's Mary." If you asked who "that" or "this" is, it would make sense for the person to reply with "that" as the subject. The only cases I can think of in which someone would reply "It's mary", would be in expressing surprise that Mary is in the picture, or in expressing surprise that you didn't recognize Mary in the picture.