Started using imagine library for image transformation
Fixed error while saving transformed image to tmp file