fix size calculation of getAllVersions()
code clean-up
fix array order
Merge pull request #6890 from owncloud/version_fix_array_order

[files_versions] fix array order