From the image, that does not look to be PVC but a metal pipe. It is possible to create a firearm from a pipe that can fire shotgun shells. Here's an example: https://www.youtube.com/watch?v=lJUtEnCLVUI
That aside, the fact that it's possible can make a firearm from a pipe, doesn't seem to me to mean that someone should do 5 years in prison... for possibly having touched a pipe... found in a pile of junk.
Either there is more to this or something went seriously wrong here legally