Fix for serializing an attachment file field
- Use obj.name instead of obj.file.name. The latter will fail with an IOException if the file does not exist or is not accessible for any reason. Also, it is needlessly slow to try to access each file just to get the name when we already have it.
Preload page list so that query won't be run twice