LPS-42705 fix issue with deleted trash versions (includes tests :)