avcodec/pnm: Use ff_set_dimensions()