Links to broken uploads in topics lead to 500 errors with 2.5.0

Thanks @david, I confirm a fresh rebuild against tests-passed worked out of the box. Thanks!
Any suggestion on a proper/easy way to get rid of those dead links in topics?