add some error handling to the get_images script