I understand that the Quran says that the flesh of a pig is forbidden for consumption, but how does that include extracts of pig skin/bones which I believe is the source for gelatin?
There is consensus that the entirety of a pig is haram1.
أجمعت الأمة على أن الخنزير بجميع أجزائه محرم
The ummah is unanimous that all parts of swine are forbidden
لا خلاف أن جملة الخنزير محرمة
There is no difference of opinion in that the entirety of a swine is forbidden
وقوله تعالى : ولحم الخنزير فإنه قد تناول شحمه وعظمه وسائر أجزائه ، ألا ترى أن الشحم المخالط للحم قد اقتضاه اللفظ ؛ لأن اسم اللحم يتناوله ؟ ولا خلاف بين الفقهاء في ذلك
Allah said: "The flesh of swine", and this includes the prohibition of its fat, bones and all parts of its body. Do you not see that when fat is mixed with meat then it comes under the same word, and the noun is inclusive of it. There is no difference of opinion on this among the jurists.
Among the basis for this is:
أو لحم خنزير فإنه رجس
or the flesh of swine - for indeed it is impure
The subject of فإنه رجس (it is impure) is خنزير (swine), so all of it is filth and hence prohibited.
And even if the subject is taken to be لحم خنزير (flesh of swine) then everything that is in contact with the flesh is contaminated by it and hence is impure and forbidden.
Flesh contaminates and is interwoven with both bones:
Note:- Potentially graphic images of flesh, do not move mouse over it if you don't wish to view.
The reason Allah specifies لحم (flesh) when prohibiting swine is that it is the part that is most cherished and customarily consumed, and when a prohibition applies to it, it is also implied to everything else and is not limited to it.
An example of this is the following:
يا أيها الذين آمنوا إذا نودي للصلاة من يوم الجمعة فاسعوا إلى ذكر الله وذروا البيع
O you who have believed, when [the adhan] is called for the prayer on the day of Jumu'ah [Friday], then proceed to the remembrance of Allah and leave trade.
This does not mean that only trade is forbidden at that time, and it is permitted to e.g. play board games instead ... but rather trade has been specified because that is what would be customary for people to be doing at that time ... and the prohibition is implied on every activity.
1:Except for its hair. According to some it is permitted to use its hair as a fibre for stitching.