Use AMI ID as a second key to sort AMIs.

Using AMI ID as a second sorting key wil preserve the sorting.