I tried this here with a sample folder.... seems to work...
so you select the lines you want to process with the script (columns sku and gallery_images) and the script overwrites the cells in "gallery_images" column with all found filenames....
--14.09.2011 hubionmac.com
-- parts of numbers selection code by http://hints.macworld.com/article.php?story=20090109055630154
-- requested @https://discussions.apple.com/thread/3325583?tstart=0
-- this script takes the value of a selection in numbers first and a asks for a folder
-- then the values of the first column of the selection are taken and all filenames of start start with that folder and are found in the defined folder will be
-- writen to the last column of the selection ----> you will have to select at least 2 columns
set thefolder to quoted form of POSIX path of ((choose folder) as alias)
tell application "Numbers"
activate
tell document 1
-- DETERMINE THE CURRENT SHEET
set current_sheet_index to 0
repeat with i from 1 to the count of sheets
tell sheet i
set x to the count of (tables whose selection range is not missing value)
end tell
if x is not 0 then
set the current_sheet_index to i
exit repeat
end if
end repeat
if the current_sheet_index is 0 then error "No sheet has a selected table."
-- GET THE VALUES OF THE SELECTED CELLS
tell sheetcurrent_sheet_index
set the current_table to the first table whose selection range is not missing value
tell the current_table
set range_column_count to count of every column of selection range
set this_rows_first_cell_index to 1
set this_rows_last_cell_index to range_column_count
-- THIS CHANGES THE VALUE OF
repeat with i from 2 to count of every cell of selection range
set thename to value of cellthis_rows_first_cell_index of selection range
set foundfilenames to my find_filenames(thefolder, thename)
set value of cellthis_rows_last_cell_index of selection range to foundfilenames
set this_rows_first_cell_index to this_rows_first_cell_index + range_column_count
set this_rows_last_cell_index to this_rows_last_cell_index + range_column_count
if this_rows_last_cell_index > (count of every cell of selection range) then exit repeat
end repeat
end tell
end tell
end tell
end tell
on find_filenames(thefolder, filename_start)
-- THIS SEARCHES FILES STARTING WITH A SPECIFIC STRING IN THEIR NAMES AND OUTPUTS JUST THEIR FILENAMES
-- IS SEARCHES IN THEFOLDER AND ALL SUB-DIRECTORIES
set theoutput to do shell script "find " & thefolder & " -iname \"" & filename_start & "*\" -exec basename {} \\;"
if theoutput ≠ "" then
set theoutput to every paragraph of theoutput
set AppleScript's text item delimiters to "; "
set theoutput to theoutput as text
set AppleScript's text item delimiters to ""
end if
return theoutput
end find_filenames