Every bend reduces your flow rate, and with a 170 cfm fan, there isn't much pressure left to play with after you add a filter.
You could flip your filter vertically , so that the duct attaches at the bottom. That will cut out one 180 degree bend. Also, you can definitely trim the ducting a...