fix width & height setup in file()

This fixes the `file` so that one can set width and height using named arguments. I also introduced a minor addition to filename parsing that defaults to png if no file extension is given.

Like always, merge if you want or use as a basis if you want to make changes!