Calculate the image version from the image itself.