private void downloadImage(ImageReference site) 
    {
        String pathSep = System.getProperty("file.separator");
        File fileToWrite = new File(directory.toString()+pathSep+site.getFileName());
        File rejectedFile = new File(directory.toString()+pathSep+"Rejected"+pathSep+site.getFileName());
        
        if (!fileToWrite.exists() && !rejectedFile.exists())
        {
            try 
            {
                BufferedImage downloadedImage = toolkitImage(site.getURL());

                if (downloadedImage==null)
                {
                    throw new IOException("Couldnt process image from toolkit.");
                }
                
                if (downloadedImage.getWidth()>=minWidth && downloadedImage.getHeight()>=minHeight)
                {
                    boolean similarToExistingImage = imageProperties.similarImageExists(downloadedImage);
                    if (!onlyUnique)
                    {
                        similarToExistingImage = false;
                    }

                    if (!similarToExistingImage)
                    {
                        String fileExtension = site.getFileExtension();
                        fileToWrite.getParentFile().mkdirs();
                        ImageIO.write(downloadedImage, fileExtension, fileToWrite);
                        imageProperties.incrementImageCount();
                    }
                    else
                    {
                        imageProperties.incrementImageRejectedCount();
                    }
                }
                else
                {
                    String fileExtension = site.getFileExtension();
                    rejectedFile.getParentFile().mkdirs();
                    ImageIO.write(downloadedImage, fileExtension, rejectedFile);
                    imageProperties.incrementImageRejectedCount();
                }
            } 
            catch (IOException e) 
            {
                logger.error("Exception Thrown When Downloading Image "+site.getFileName());
                logger.error(e);
            }
        }
    }