Regarding gelatine, if you do the research and find that it goes through complete transformation in the manufacturing process then it’s ok to consume
This is the answer of Ayatollah Sistani re alcohol in medicines
It is permissible to consume if the amount is very minute, e.g. 2%
If the amount of alcohol is more than 2%, then one may dilute the medication with water, so that the amount of alcohol becomes very minute, e.g. 2% or less and then consume it.