rotate and merge images using PIL