private boolean isImage(String url){
  return url.matches(Regex.IMAGE_PATTERN);
}

private boolean isImage ( String url ) { return url . matches ( Regex . IMAGE_PATTERN ) ; }
verifies if the url is an image
