store public images as json

Not ready for merge. Would like Hal to test though.