Media: open files in binary mode.

This makes python3 happy. the project is now fully working under python3.