some fixes for media page, code quality