Find the number of image in a web page using selenium web driver

Find the number of image in a web page using selenium web driver

public class Anchortags {
 
/**
* @param args
* @throws InterruptedException 
*/
public static void main(String[] args) throws InterruptedException {
 
System.setProperty("webdriver.chrome.driver", "C:\\batch230\\chromedriver.exe");
 
     WebDriver driver= new ChromeDriver();
 
 
     Thread.sleep(5000);
 
     driver.manage().window().maximize();
 
     Thread.sleep(5000);
 
        // count the number of images in a web page which are developed using <img> 
 
        List<WebElement> l1=driver.findElements(By.tagName("img"));
        
        //List<WebElement> l2=driver.findElements(By.xpath("//[@type='image']"));
 
         int count= l1.size();
 
         System.out.println(count);
}
 
}