Given how this is being updated, what happens if you had a 7 page PDF, then uploaded a new version that was a 5 page PDF. From what I can tell you might end up with 2 trailing pages that don't get purged from the previews (page 6 and 7)?

If that's the case, might be better to delete first, then replace.