That question and answer you linked said everything about why you absolutely should tell the child the truth. At seven your grand is perfectly capable of understanding the concepts of right and wrong; understands making mistakes and also understands punishment.
The mother is paying for the mistake she made. If it is true, say that Mother is sorry and is trying to do better. You'll have to tell the truth about the crime, too. That could be a problem depending on the nature of the crime. Theft is a much more simple explanation than prostitution, but regardless truth is important. Do not make excuses, just tell the truth as kindly as you are able to.
Separate the person from the crime. Mother is not labelled by you. The crime might be named, but you do not call Mother a thief or a drug dealer. "Mom made a serious mistake. The judge put her in jail/prison for x amount of time. Mom is trying to fix this by being good in prison. She loves you and wishes she had not made that mistake."
I hope your grand does get to visit. If nothing else she'll see her mum is safe and that she still loves her daughter.
Encourage the relationship (unless custody was refused or visitations refused.) Letters, drawings, visits and phone calls will all help. Take photos and report cards and examples of projects or school work that your grand can share with her mother. A journal that your grand can choose to share with Mother (or not share) can help her with her feelings. She can draw, use photos and write things in her journal.
My daughter's birth mum and dad died. She had a journal that was really a decorated accordion file folder. She wrote, drew pictures and shared photos and 'shared' them with her Mummy and Daddy. We do not pray but we do speak aloud our gratitude, and in addition she spoke to them every night before bed -- just to tell them what she was doing. This was our 'key' to helping our child get past the trauma. You might try something like this for your granddaughter. We keep Mummy and Daddy alive by talking about them frequently. You can keep Mother as an active but absent family member in the same way.