I haven’t done this and don’t think that’s easily possible but alternatively you could have two separate fields, one for images and one for other files, and have a conditional field (select/radio button) to show the right field depending on the editor’s choice.