Cleaned up media.py