handle file over mimetype, only set animated to true when output file is gif, fix filename encoding