When setting up the image field there is a setting for return value, you can set this to url, id or object/array. Information on how to work with each of these is in the image field documentation https://www.advancedcustomfields.com/resources/image/.