created function to find besrt translation between images