don't urldecode get var, php does this automatically
remove empty line
Fixed double file encoding for previews