Fix filter parameter in toBuffer method

I tried to write a png to disk using a custom compressionLevel and filter method. But it always failed with ```libpng error: Unknown row filter for method 0```. I found this line in the code and it seems to me that the filter is using the wrong index for the parameter (```args[1]``` is compressionLevel). So I fixed it.