You simply could store it as "data/metamirror/pic.jpg".
Since in Xenforo all content comes from index.php in the root directory, this will always be a correct, non-broken URL and would allow the forum owner to switch the domain, the protocol and/or even the install directory without having to "search and replace" each single post message in his database.
Storing the images as "
http://www.domain.com/installdirectory/data/metamirror/jpg" is only necessary if the forum uses a CDN, which also never can be changed easily. Maybe some kind of BB-Media code would also work? Like IMG-META working like IMG, but translates the path to the current CDN (or local storage)? If someone decides to deinstall your add-on he simply has to have a simple BB media code which instructs XF to handle "IMG-META" like "IMG".
At least it would be perfect to include a (deferred) rename function which allows to update all posts, if someone decides to switch the CDN, domain name, install directory or to/from SSL.