public BufferedImage readImage() {
        if (imageStore != null)
            return imageStore;

        // if caching, write the image to file;
        if (isCached) {//isCachingEnabled) {
            BufferedImage image = null;
            try {

                image = ImageIO.read(tempFile);
                // get length of temp file
                length = tempFile.length();

            } catch (IOException e) {
                logger.log(Level.FINE,
                        "Error creating ImageCache temporary file ", e);
            }
            // imageStore = image;
            return image;
        }
        return null;
    }