Rework image transformations

Work in progress