Handle file upload error messages from the api

Pass error messages from the api generated when uploading images though to js on the page