While it might not feel great, it is legal, if the following are true:
- The children lived with your mother
- The children are related to your mother as her grandchildren
- They do not file a joint tax return
- They do not provide more than half of their own support
- Your mother and the children lived in the U.S.
- You do not make more money than your mother