restructure the image class and transformation