Improvements to file name and mime type handling for image uploads and some rendering improvements