Ok so when I'd make it:

width: getIndicatorWidth(imageVisible, textVisible, indicatorImage.width, indicatorText.width)
It would be better? 

And then the function to have:

function getIndicatorWidth(imageVisible, textVisible, indicatorImage.width, indicatorText.width)
    {
    //Check if we show the image
        if (imageVisible)
        {
            //Check if we also show the text
            if (textVisible)
            {
                //return the max width for image or text
                return Math.max(indicatorImage.width, indicatorText.width)
            }
            else    
            {
                //When we only have image, we'll return it's width
                return indicatorImage.width;
            }
        }
        else if (textVisible)
        {
            //We only have text so we return it's width
            return indicatorText.width;
        }
    }