class MediaButton extends StackPaneButton {

    void setupImage() {
        if (mediaFile != null && mediaFile.getImagepath() != null) {
            final File f = new File(mediaFile.getImagepath());
            final ImageView iv = new ImageView(new Image(f.toURI().toString()));
            iv.setPreserveRatio(true);
            iv.fitHeightProperty().bind(this.getButton().heightProperty().multiply(9.0 / 10.0));
            iv.fitWidthProperty().bind(this.getButton().widthProperty().multiply(9.0 / 10.0));
            this.getButton().setGraphic(iv);
        } else {
            this.getButton().setGraphic(null);
        }
    }

      MediaButton(double width, double height);

}