Allow AGG images bigger than 2 GB (#4421)

Necessary changes, but not necessarily sufficient...