Transport characteristics of nano-sized superconducting strips and bridges are determined by an intricate interplay of surface and bulk pinning. In the limiting case of a very narrow bridge, the critical current is mostly defined by its surface barrier, while in the opposite case of very wide strips it is dominated by its bulk pinning properties. Here we present a detailed study of the intermediate regime, where the critical current is determined, both, by randomly placed pinning centres and by the Bean-Livingston barrier at the edge of the superconducting strip in an external magnetic field. We use the time-dependent Ginzburg-Landau equations to describe the vortex dynamics and current distribution in the critical regime. Our studies reveal that while the bulk defects arrest vortex motion away from the edges, defects in their close vicinity promote vortex penetration, thus suppressing the critical current. We determine the spatial distribution of the defects optimizing the critical current and find that it is in general non-uniform and asymmetric: the barrier at the vortex-exit edge influence the critical current much stronger than the vortex-entrance edge. Furthermore, this optimized defect distribution has a more than 30% higher critical current density than a homogeneously disorder superconducting film.