fix(build_image): move upload calls to build_library

This will let the image building code upload extra data without the
wrapper script having to know about it.
feat(build_image): Generate lists of image contents

Index contents by file and package.