There are several possibilities, and the hierarchy will vary from one place to the next.
But in general, the idea of precedence is the starting point. That is, who published the image first? Absent of any other compelling evidence to the contrary, the person who first published the image will probably be recognized as the author of the image.
Things that could possibly override the earliest original publication date:
- If one party can produce a higher resolution version of the image than the other (that does not appear to only be an up-scaled version of the information contained in the smaller sized version), or any other more pristine version of the image. For instance, a less compressed version of the image at the same resolution would carry similar weight as a higher resolution version would.
- Copyright information in the metadata of both images that agrees that the same person is the author of both images. Almost all major publications require the IPTC metadata in an image to include copyright owner/author information.¹
- A camera or lens serial number in the metadata of both published images that matches a camera or lens to which one but not the other had access.¹
- Any other details in both copies of the image or its metadata that can establish a specific camera produced the image if only one of the two persons claiming to have the produced the image had access to that specific camera.²
- Corroborating evidence that one but not the other person was present at the time and place the image was captured. If the image is from a specific event and one person was issued a media pass that placed them in the position to have captured the shot from a "press only" area while the other person can not demonstrate they were present at the event then the person who can demonstrate that they were there probably prevails. This would be particularly the case if everyone who had access to the place from which the image was recorded required documentation/registration/media pass/etc.
- The testimony/deposition of any persons pictured in the photo, or person(s) who witnessed the photo being taken, as to who took the photo.
¹ Please notice that all references to metadata as valid for determining authorship is placed in the context of both versions of the image as published by both parties having the same metadata content for the particular fields in question. It would also be based upon the premise that the actual image information can be shown to have been produced by the camera indicated in the metadata. If the metadata does not agree, then it would behoove both parties to make their case based on other factors, or to establish that their version of the metadata is the original version using whatever forensic methods they may have at their disposal. Please see note 2 below for more regarding congruence between image information and metadata.
The question seems to demonstrate no awareness that such information can even exist within the image file itself. It therefore seems possible that a party who violates someone else's copyright might also be unaware of such metadata and publish the image as their own without altering the metadata. In such a case, establishment of ownership would likely be resolved long before going to trial.
² For instance, if the content of the actual image data does not match those used by the camera indicated in the metadata, that would raise a red flag that the metadata has, in fact, been altered. It could be one or more of any number of things: Does the compression algorithm used, or the pixel mapping used to map out hot pixels, or other sensor characteristics revealed by the actual image data, match the camera referenced in the camera information fields of the metadata? Is the serial number in the metadata a valid serial number for the type of camera that took the image? Can the camera indicated in the metadata have been used to produce the image in question, or is there some characteristic of the actual image contents that eliminates any possibly doctored metadata, such as camera identifying EXIF fields, from being valid?