Added ability to specify device and dpi from child template