added possibility of setting the MIME type and transformation