Fixing the issue where the first API call to find a copied AMI fails and
so this code retries 5 times