Added ability for margin to be NULL in zscore_img.