Should I represent two distinct relationships via only one associative table?
To delete a news-category pair in schema B, you have to do either a DELETE or an UPDATE depending on whether the relevant row has id_gallery specified or not. How about inserts, are you going to just INSERT or check first for rows with nulls to UPDATE?

So, I strongly recommend option A. However, I would drop the surrogate id columns and use (id_news, id_category) and (id_news, id_gallery) as PK.