[eluser]CroNiX[/eluser]
Yes, but it would take a LOT of work, and probably not turn out all that hot (compared to doing the same thing in photoshop).
Off the top of my head you'd probably have to use javascript to get the image locations in relation to each other (assuming they aren't all 100% aligned to each other or the same size) along with their stacking order, and then pass that info to a custom image processing script that will turn the jpgs into pngs with alpha channel, align them how they were, stack them in order and create a final image from that. You have your work cut out for you.