Folded making of test image into a separate method.
Added image decode method.