Detect range of the image using bottleneck if available and handle NaN values