Credit: Jason LaVeris/FilmMagic

Mark Salling was arraigned for charges of receiving and possessing child pornography on Friday.

The former Glee actor was named in a two-count indictment on May 27, alleging he received and possessed videos and still images of child pornography involving young girls, for which he was arrested in December 2015. According to investigators, the laptop, a hard drive, and a USB flash drive seized from Salling’s residence allegedly contained thousands of images and videos depicting child pornography.

According to Department of Justice, receiving child pornography carries a mandatory minimum sentence of five years in federal prison and a statutory maximum sentence of 20 years. Possessing child pornography also carries a statutory maximum sentence of 20 years in federal prison.

“The charges are very serious,” criminal defense attorney Lou Shapiro told PEOPLE, but – depending on what was found in his possession and if he is convicted – Salling could potentially avoid jail time.

“If he had a few images, a few videos, he could get out of prison altogether,” says Shapiro, who is not involved with the case. “If he had boatloads of them, that’s a different matter. That’s what it’s going to come down to, the numerical amount.”

On Tuesday the executive producer of Salling’s upcoming miniseries Gods and Secrets announced he was removed from the project. “He has been cut from the miniseries,” Adi Shankar wrote in a statement. “I will personally be paying for the reshoots, and I hope that Mark finds inner peace.”