Changed reordering function

When adding scanned questionnaires with misplaced or missing pages, I was always ending up with multiple sheet with the same questionnaire_id and the reorder function was not correctly reordering them.
I changed the reorder function, now it correctly reorders surveys with misplaced pages and doesn't create multiple sheets with the same questionnaire_id.