显示图像而不是文本

I am very new in php. I have a site with the CMS joomla 3.6. In the register of a third part component I have a select box to the members inform his gender. In the html of the page, returns the text 'male' and 'female'. What I need is to replace the text 'male' and 'female' with images.

In the PHP file I have this:

public function getFieldData($field) {
    $options = array("COM_COMMUNITY_MALE" => "COM_COMMUNITY_MALE", "COM_COMMUNITY_FEMALE" => "COM_COMMUNITY_FEMALE");
    $value = strtoupper($field['value']);
    if ( isset($options[$value])) {
        return JText::_($options[$value]);
    }else {
        return '';
    }
}

So, I know that the second "COM_COMMUNITY_MALE" and "COM_COMMUNITY_FEMALE" are the output html and I have tried to replace them with that code <img src="image/image.png"/>. But no luck, can someone tell me what is the path to do this?

Thank you in advance for your attention.

The problem is that you are using a dropdown box, and, for example, COM_COMMUNITY_MALE is the value and the label of one of the options in that dropdown box, and you can't have a value in a dropdown that is HTML code (for example, an img tag). You will need to review your requirements.