When the other image had no variances, out.var was assigned ima_var, which was a misspelling of ima.var.