issue #3, added test and add the missing boundary check.
issue #4, added test case to prove that GMBatchCommand supports BufferedImage as input.