Competition between vortex and "s"-like states in laterally confined magnetic trilayers