explicit call to pgslct before pgclos

This seems to help with the png generation.