Both accept a number of query parameters, one of them is imgmax. If you specify the value d for this parameter, then the list returned by the URL will contain URLs to the original images (or the largest available version of the images, if the originals are not accessible to you).

If you're using linux, install either xmllint or XMLStarlet. Both let you execute XPath queries against an XML document. Using the latter, you can easily retrieve all image URLs with this one-liner: