Revert "If generating an image, run initialization and other optimizations." am: bbec8a6fc7

Change-Id: I9341465e6413e5e0d7a192da17872f6a77d0c382