I think you are looking for ImageView.setTag()
and ImageView.getTag()
.It checks if the image is associated with the Image view as @ρяσѕρєя K mentioned in comment.
There are two version of setTag one which takes object as an argument and other takes key and object as an argument