Fixed bug

1. Changed field of media
2. Changed Pi::registry('user') to Pi::user()