Fix for reading Multipage Tiffs

Rebased, cleaned up version of #865, #873, #881. 

Fix for #862.