Fix an issue where by a call to ec2.get_image wasn't wrapped in a try/except, and would occasionally throw an exception in the wild. Also greatly simplifies two of the ugliest known loops to man down into a single loop. (#2554)
module.fail_json(msg="Error while trying to find the new image. Using wait=yes and/or a longer wait_timeout may help. %s: %s"%(e.error_code,e.error_message))