replase BufferedImage to custom image class