Fix EZP-23152: deleteVersion removes images from published version

JIRA: https://jira.ez.no/browse/EZP-23152

Image references are removed in the assumption there are no other field ids using it, which may not be true.
This adds a check for additional versions using the same id, and does not remove the reference in that case.

TODO: add integration/regression test?
a bit lost here. as we haven't deleted yet, woldn't this return at least 1?
Apart from that, $path is passed to the function to get this number but never used in the new function?