Your AI file is probably taking that long because you specified a high density. You might get a better performance when you lower that value but that will affect the quality of your image.
The reason that you are getting the layers side by side is because you call the method AppendHorizontally. It combines the images into a side by side image.
The reason that you are getting the layers side by side is because you call the method AppendHorizontally. It combines the images into a side by side image.