adding image rotation and thumbnailing