i have got here a batch file whch you could put to the root folder of your mounted boot.wim file:[You must be registered and logged in to see this link.]
it removes a lot of things for me @WINDOWS 7 !!! and an german x64 ISO.
so i cant say for sure if it will work with win8.1, and also it could be that it will destry your boot.wim so you would need to test it step by step
EDIT: my windows 7 x64 boot.wim is after using this batch 44.6 Mb big