speed up file/image performance

this eliminates a LOT of unnecessary db queries
this is barely worth it but should be low risk