adding support for multiple AMIs and correcting some gradle dependencies