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

This reverts commit bbec8a6fc720ee5ce572d3fb63617fb0af6addc7.

Reason for revert: Fix vdex compilation with app images.

Test: 628-vdex
Bug: 150193586

Change-Id: Ic4d0445f277caf9405c18938c1f39ee08b9bf2fd
4 files changed