changed docsplit function to only use the first page and use jpg