Refactor PngWriter._build_image_data() to take a 'frame' argument