public function scaleAndStore($filename, $id, $template = null, $overwrite = false) {
        $templates = !is_null($template) ?
            (array)$template :
            //  template is left empty; scale source file along all configured templates
            $templates = $this->getTemplateNames();

        $file       = new Garp_Image_File(Garp_File::FILE_VARIANT_UPLOAD);
        $sourceData = $file->fetch($filename);
        $imageType  = $file->getImageType($filename);

        foreach ($templates as $template) {
            $this->_scaleAndStoreForTemplate($sourceData, $imageType, $id, $template, $overwrite);
        }
    }