Check out java.io.FilenameFilter Both java.io.File.list() and java.io.File.listFiles() are overloaded to take a FilenameFilter to filter file listings. You should also be careful to handle name collisions. That is, if you have picture.jpg and something with that name already exists in the destination directory, what do you want to do? Overwrite it? Skip it? Rename one or both of them? You'll want to test that carefully before letting it loose on your real image files.
This will fetch all the files with extension .jpg from D:/Pictures/Holidays. Here i have user FilenameFilter interface and have implemeted its accept method so that it accepts only those file of provided extension.