public void setSourccePreview() {
        InputStream is;
        try {
            BufferedImage src = ImageIO.read(new File(sourcePath));
            if (src.getWidth() >= 150 || src.getHeight() >= 150) {
                BufferedImage prevIMG = new BufferedImage(150, 150, src.getType());

                for (int i = 0; i < 150; i++) {
                    for (int j = 0; j < 150; j++) {
                        prevIMG.setRGB(i, j, src.getRGB(i, j));
                    }
                }
                ByteArrayOutputStream os = new ByteArrayOutputStream();
                ImageIO.write(prevIMG, "png", os);
                is = new ByteArrayInputStream(os.toByteArray());
            } else {
                is = new FileInputStream(sourcePath);
            }
            Image sourcePreview = new Image(is);
            sourceView.setImage(sourcePreview);
            targetView.setImage(sourcePreview);
            is.close();

        } catch (IOException e) {
            e.printStackTrace();
        }
    }