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