fixed bug with upside-down scanner.