Properly handle variable attachment sizes in detail view