Fix problems with supporting multiple images.
Remove debugging printlns.