Don't display caption or credit section if empty.

Also fixed some pep8 issues.
remove properties and compute everything in template
Strip caption/credit when checking for content.
refactor by sending context variables
Merge pull request #41 from pbs/LUN-1510

Don't display caption or credit section if empty.