Fix a crash for files with dimensions non-multiple of two.