Yes, Your sentence and use of 'who' is fine.
Collins on-line dictionary gives one definition of who as follows:
You use who at the beginning of a relative clause when specifying the person or group of people you are talking about or when giving more information about them.
So, 'who' can only be used to specify a person or persons, it cannot be used to specify an object, e.g. a hand. The antecedent of a relative pronoun is usually the last noun used in the sentence before the relative pronoun is used. The antecedent does not have to be placed immediately before the relative pronoun, there can be other words between them. As the relative pronoun 'who' has to have a person as an antecedent, then we are looking for the last person named, or mentioned in some other manner, before the relative pronoun. In this case the last person named is Mary, so 'who' has to refer to Mary.