40 is the correct answer.
Sure, 40 is the answer. Just to share how i did this, made a table with two columns, one for substance A and and for B. I started with the known (16 gal of B) then added the mixture until I saw the correct ratio:
We see that 15 and 25 are in 3:5 ratio and add up to 40. Perhaps this is not the cleanest way, and definitely would not work for "messy" numbers, but as the GMAT is generally clean, it is OK here.
Perhaps gambling with iterations..
Anyways i feel one should choose a method which suits him the best.
As to more algebraic approach, Stolyar has the solution posted for you.