tested with XWiki 14.10.20
According to https://www.xwiki.org/xwiki/bin/view/XWiki/XWikiSyntaxImages
to align images one should use this syntax:
[[image:img.png||style="float:right"]]
This works (image on the right, text flows around at the left).
To add a caption one should use this syntax:
[[caption>>image:img.png]]
This works.
However, if you combine both (as you might deduce from the description):
[[caption>>image:img.png||style="float:right"]]
the image is on the right and the text flows around at the left, but the caption is separated and is displayed on the left.
This is a very unexpected behavior for the users. Either style=“float:right” should work together with captions or the incompatibility of both parameters should be mentioned in the syntax documentation page.
As a workaround one could use:
[[caption>>image:img.png||data-xwiki-image-style-alignment="end"]]