XWIKI-10014: Failed to import attachments with multiple versions in some version of Confluence

(cherry picked from commit 98ba3a25d85cbae42f0a921cdf667c6a8112fa39)