protected function _deletePicture($sPicName, $sAbsDynImageDir)
    {
        $blDeleted = false;
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        if (!$myConfig->isDemoShop() && (strpos($sPicName, 'nopic.jpg') === false ||
                                         strpos($sPicName, 'nopic_ico.jpg') === false)
        ) {
            $sFile = "$sAbsDynImageDir/$sPicName";

            if (file_exists($sFile) && is_file($sFile)) {
                $blDeleted = unlink($sFile);
            }

            if (!$myConfig->getConfigParam('sAltImageUrl')) {
                // deleting various size generated images
                $sGenPath = str_replace('/master/', '/generated/', $sAbsDynImageDir);
                $aFiles = glob("{$sGenPath}*/{$sPicName}");
                if (is_array($aFiles)) {
                    foreach ($aFiles as $sFile) {
                        $blDeleted = unlink($sFile);
                    }
                }
            }
        }

        return $blDeleted;
    }