Adding default orientation depending on tpl size

Instead of always having 'P' as default orientation, using the templatesize to determine if it's portrait or landscape
Typo in ternary operator
Merge branch 'Meyfarth-patch-1' into 3.0
Merge branch '3.0'