public function getFileReference($row)
    {
        list($type) = explode(':', $row['type']);
        switch ($type) {
            case 'page':
                if ($this->conf['showPageImages']) {

                    // first check if "tx_kesearch_resultimage" is set
                    $result = $this->getFirstFalRelationUid(
                        'pages', 'tx_kesearch_resultimage', $row['orig_uid']
                    );

                    // fallback to standard "media" field
                    if (empty($result)) {
                        $result = $this->getFirstFalRelationUid(
                            'pages', 'media', $row['orig_uid']
                        );
                    }
                    return $result;
                }
                break;

            case 'news':
                if ($this->conf['showNewsImages']) {
                    return $this->getFirstFalRelationUid(
                        'tx_news_domain_model_news', 'fal_media', $row['orig_uid']
                    );
                }
                break;
        }
    }