public/Get-RecipeImagePath.ps1

function Get-RecipeImagePath {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory)]
        [int]$RecipeId
    )

    $recipe = Get-RecipeById -RecipeId $RecipeId
    if (-not $recipe -or -not $recipe.ImageFileName) {
        return $null
    }

    $path = Get-RecipeImageFilePath -RecipeId $RecipeId -FileName $recipe.ImageFileName

    if (-not (Test-Path $path)) {
        return $null
    }

    $path
}