cleanup and handle urls with special characters for filename