image adjustments and optims

(cherry picked from commit 6e169de7260a9289591760e689a5ccd5262ccfce)