Revert "Update to TWAIN functions"

This reverts commit 2920e81cba83b415b8c45c8789a24e80530dff10.