Fix problem where quickflat will generate all nan images