accept FreeImage flags in imread/imwrite

Fixes #1195.