After all that, it looks like the problem was with the memory limit
after all....
I foolishly assumed that setting the max memory to 128 was overkill
for pretty much anything - without doing the math.
The test images I was using were around 6000x4800... which comes out
at around 110mb memory usage by your math Tom. Obviously close enough
to the 128 to be the issue as upping it to 258 solves the problem
completely.
Thanks for your help - I should have checked it more thoroughly.
Clearly those images are unrealistically large, but now that I
understand where the limit comes from I can set it to something
reasonable and make sure the users of the site know what the
boundaries are.