If you use Kgpanels or the like you can simply make the target and tot the parent of the background texture. That way if you don't have a target the background won't show up.
If you're doing this through pure lua I'm sure someone will come along and pass along some incantation that will work.