Image Tracking Vs Javascript

I would like to know a bit more about the pros and cons of using Image / Pixel tracking over the Javascript and vice versa.

Which is the better / more reliable method?

Anyone have any thoughts on this?

EDIT: Just realised much of the info we need does not get tracked by the image.

See Tracking API - Analytics Platform - Matomo