checking for null BufferedImage