public JLabel draw(Card card, int x, int y, int index, boolean grey) throws IOException {
        String fileName;
        if (grey) {
            fileName = pictureDirectory + card.toString() + "_grey" + pictureType;
        } else {
            fileName = pictureDirectory + card.toString() + pictureType;
        }
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        InputStream input = classLoader.getResourceAsStream(fileName);        
        BufferedImage picture = ImageIO.read(input);
        JLabel pictureLabel = new JLabel(new ImageIcon(picture));

        container.add(pictureLabel, index);

        Insets insets = container.getInsets();
        Dimension size = pictureLabel.getPreferredSize();

        pictureLabel.setBounds(x + insets.left, y + insets.top, size.width, size.height);

        return pictureLabel;
    }