The server does not have access to team texture image prefixes as those are handled as client-side BZDB values.
Unpack the dialog item labels, and unpack the dialog buttons outside of the dialog items loop.