Fixed indexing issues. writes SOME black pixels to tiff