indeed by far the best way to do it is to scrape the actual rendered html thus you're using the wiki parser to include all of the images for you then just grep the html source for all of the image tags and parse out the actual wiki names of the images using the links that they're wrapped in