image adjustments and optims

(cherry picked from commit 6c4aa927b25eed32ecb9f4270fff3c649926306b)