You want to regularly backup your EC2 instances, but only keep the last N images so that you can retain an isolated use case oriented set of images in an orderly fashion.
This can be achieved by using the EC2 Image task's Grow & Prune Image Backup Set action as follows:
Specify the Instance ID (or a Filters JSON) to select the instance(s) you want to retain backups for.
Choose an applicable Backup Set name for your use case so that you can retain different sets and identify the images in the AWS Management Console (they will be automatically tagged with that name).
Specify the Backup Retention number N (the number of images that should be retained in this backup set).
Arrange for the Bamboo build to trigger at an interval applicable for your use case, for example via cron-based scheduling to retain daily backups of your instances, or after you have pushed changes to your repository to backup your instances before deploying new code.