public Image getImage(String s, Color fill) {

        // check xobjects for stream
        Stream st = (Stream) library.getObject(xobjects, s);
        if (st == null) {
            return null;
        }
        // return null if the xobject is not an image
        if (!st.isImageSubtype()) {
            return null;
        }
        // lastly return the images.
        Image image = null;
        try {
            image = st.getImage(fill, this, true);
            // clean up the stream's resources.
            st.dispose(true);
        }
        catch (Exception e) {
            logger.log(Level.FINE, "Error getting image by name: " + s, e);
        }
        return image;
    }