@SuppressWarnings({"BroadCatchBlock", "TooBroadCatch"})
    private void createThumbnail(String serie, String albumString, int serieId, int albumId) throws IOException {
        Logger.getLogger(ReportGenerator.class.getName()).entering(ReportGenerator.class.getName(), "createThumbnail", new Object[] {serie, albumString, serieId, albumId});
        File album = new File(baseDir.toString() + File.separatorChar + serie + File.separatorChar + albumString);
        File destinationFile = new File(reportFolder + "thumbnails" + File.separatorChar + "Comic" + serieId + "-" + albumId + ".png");
        BufferedImage previewImage = null;
        try {
            if (album.isDirectory()) {
                previewImage = new FolderHandler(album).getImage(1);
            } else if (album.getName().toLowerCase().endsWith(".zip") || album.getName().toLowerCase().endsWith(".cbz")) {
                previewImage = new ZipHandler(album).getImage(1);
            } else if (album.getName().toLowerCase().endsWith(".rar") || album.getName().toLowerCase().endsWith(".cbr")) {
                previewImage = new RarHandler(album).getImage(1);
            } else if (album.getName().toLowerCase().endsWith(".pdf")) {
                previewImage = new PdfHandler(album).getImage(1);
            }
            BufferedImage thumbnailImage = ImageReader.getThumbnailImage(previewImage);
            if (previewImage != null) {
                previewImage.flush();
            }
            if (thumbnailImage != null) {
                ImageIO.write(thumbnailImage, "png", destinationFile);
            }
        } catch(Exception ex) {
            Image noImageThumbnail = ImageIO.read(ClassLoader.getSystemResourceAsStream("booknaviger/resources/graphics/htmlreport/noImageAvailable.png"));
            ImageIO.write((RenderedImage) noImageThumbnail, "png", new FileOutputStream(destinationFile));
        }
        Logger.getLogger(ReportGenerator.class.getName()).exiting(ReportGenerator.class.getName(), "createThumbnail");
    }