Fixed array out of range

When using templates to create composite PDF's occasionally this value is undefined.