check validity of profile or image before saving

this fixes a bug in the web UI where saving a system silently
failed if neither profile nor image were given. The cli checks
that case and returns an error