Fixed generateAssetName method to handle correctly paths when one of the parent directories' name equals to the name of the asset