Check gradient element exists before using it