# using the images collection, iterate through all of the images on a page
browser.images.each do |x|
idx += 1
# apparently the string accepted by the string method will not allow variable substitution
location = 'D:\file' + idx.to_s + '.jpg'
puts location
x.save(location)
end