Solved the problem by using this equation
image.contentWidth / image.contentHeight * display.contentHeight
local sessionComplete = function(event)
local image = event.target
if image then
imgWidth = image.contentWidth / image.contentHeight * display.contentHeight
image.x = centerX
image.y = centerY
image.width = imgWidth
image.height = display.contentHeight
end
end