add preserve_bad_pixels to hcongrid and fix offsets in zoom