You can analyze and filter script that extracts information from PNG, and such unusual script would draw attention.
Cookie stored as a simple variable in a cached JS file is IMHO better solution if you're trying to be sneaky — there's nothing unusual in variable assignment or cacheable JS file.
http://joshduck.com/blog/2010/01/29/abusing-the-cache-tracki...