Refactoring : use a HashMap to store the BufferedImage.