used tertiary operator to make card button image setting code more compact