builder: handle duplicated images (RHBZ#1092753).

Filter the available images, removing the versions with an older
revisions, and duplicates.