Check effect of resolution in masking.
Add warning to size_thresh when the beam width is zero.