If the jailed mother signs a custodial agreement as to you before a notary public giving you some semblance of custody as to the minor you can legally have custody of him or her. To assist you in the endeavor I suggest that you consult with a family law attorney for help.