Should not need to use " && img != null", "if (img" takes care of that check.