Look, as a retired police officer, I have watched how a good defense attorney can sink a prosecuting attorney over something like this. The fact that they let the burgers off for their testimony is a start.
As for chain of custody, the miscreants that gave the CD’s to the police doesn’t give credence to any chain of custody.
Those must have been some really poor prosecutors you watched, more than the defense attorneys being good.
This is not a hard case to win if the seized materials are inculpatory as well. If the ONLY incriminating evidence is what the two burglars brought in, then a case could be made that there is reasonable doubt that it was ever in the defendant’s possession.
I have more problems with the approach to possession of child porn as a status crime in itself, without proof of intent. It is too easy to be planted, even remotely.