Refactored image fixing.
Rearranged things.