Fix invalid image movement when using keyboard to move image