private String findImageName(Image i){
  for (  String name : resources.getImageResourceNames()) {
    if (resources.getImage(name) == i) {
      return name;
    }
  }
  return null;
}

private String findImageName ( Image i ) { for ( String name : resources . getImageResourceNames ( ) ) { if ( resources . getImage ( name ) == i ) { return name ; } } return null ; }
finds the image name in the resource file or returns null
