Specify the length to avoid issues with pointer out of bounds problems should
the png generated take less space than expected.