Get single image from a loop for create a search template

I want to get a single image from my images loop. now I have this template

{{- $.Scratch.Add "index" slice -}}
{{- range .Site.RegularPages -}}

{{- $.Scratch.Add "index" (dict "title" .Title "tags" .Params.tags "image" .Params.images 
"categories" .Params.categories "contents" .Plain "permalink" .Permalink) -}}

{{- end -}}
{{- $.Scratch.Get "index" | jsonify -}}

but it’s getting all the images, but I need just the first one. can anyone help?

{{- range first 1 .Site.RegularPages -}}

I know this, but it’s not working in this template, you can’t use range in "image" .Params.images here

Sorry, I thought you wanted to limit to the first page. To get the first image:

{{- $.Scratch.Add "index" (dict "image" (index .Params.images 0)) -}}