fix clipping of images with qimage2ndarray version 1.0

Using the "Adjust thresholds" context menu on a grayscale layer
would result in incorrect behavior because the data was not correctly
clipped