Improved security:create-user-metadata().

References #446.
Fix for uploading image in newly created collection, which failed.

References #462.