Updated PNG Generator Sample

I fixed a few bugs in the ImageGenerator sample. One was related to non-square images and the other was related to images larger than 64K. If you're using this sample, you'll want to pick up the updated source here.

Thanks to planetmarshalluk for the bug report on the 64K issue.