fixed input image bug, fixed lat long calculations