I think you should
function a(files, images)
for i=1:2:length(files)
...
end
end
if you really want to pass them in a separate arguments
function a(args...)
files = args[1:2:end÷2]
imgs = args[2:2:end÷2]
for i=1:length(files)
..
end
end