refactor detail.php to template.php

- refactor detail en mediamanager link creation
- refactor metadata listing
Update lang of img pagetools
Merge pull request #573 from splitbrain/FS#2437detailphprefactor

refactor detail.php to template.php