Fix bug where no fileextension lead to 500