The role of the stray field on superconducting properties of hybrid ferromagnetic/superconducting heterostructures