$files will contain whatever Get-ChildItem returns – so you can use any switch of Get-ChildItem, and that includes -Include.
You need to consider how you’re running Get-ChildItem. The error tells me that it returned the file c:\scripts\PowerShell\test.jpg. I can’t tell you how that path got into $files. I’m assuming you modified Get-ChildItem somehow, or did something. Try adding a line to your script like Write-Output $files. That would come after the Get-ChildItem and before the ForEach. That’ll let you see that the variable contains. If you’re not happy with what it contains, then modify your Get-ChildItem appropriately.