PS: jpeg is not a very good format for storing pages, it uses lossy compression, and it is noticeable.
I suggest using PNG instead. The code is the same, but use TPngImage instead of TJPEGImage, and 'png' extension instead of 'jpg'.