Function ImageExists(img)

Returns true if img is associated with an allocated image in memory