Convert a 2d image to 3d image