Fix a bug with the selection of a renamed image