protected function _renderUpload(
        $imageIdOrRecord, $template = null, array $htmlAttribs = array(), $partial = ''
    ) {
        if (!empty($template)) {
            $scaler = $this->_getImageScaler();
            $src = $scaler->getScaledUrl($imageIdOrRecord, $template);
            $tplScalingParams = $scaler->getTemplateParameters($template);
            $htmlAttribs = array_merge(
                $htmlAttribs,
                $this->_getHtmlAttribsFromSizeParams($tplScalingParams)
            );
        } else {
            if ($imageIdOrRecord instanceof Garp_Db_Table_Row) {
                $filename = $imageIdOrRecord->filename;
            } else {
                $imageModel = new Model_Image();
                $filename = $imageModel->fetchFilenameById($imageIdOrRecord);
            }
            $file = new Garp_Image_File(Garp_File::FILE_VARIANT_UPLOAD);
            $src = $file->getUrl($filename);
        }

        if (!array_key_exists('alt', $htmlAttribs)) {
            $htmlAttribs['alt'] = '';
        }

        $htmlAttribs['src'] = $src;
        $imgTag = '<img' . $this->_htmlAttribs($htmlAttribs) . '>';

        if ($imageIdOrRecord instanceof Garp_Db_Table_Row) {
            if ($partial) {
                $module  = 'default';
            } else {
                $partial = 'partials/image.phtml';
                $module  = 'g';
            }
            return $this->view->partial(
                $partial,
                $module,
                array(
                    'imgTag' => $imgTag,
                    'imgObject' => $imageIdOrRecord
                )
            );
        } else {
            return $imgTag;
        }
    }