Fixes for the channel record item

Use flag to update the class only when needed.
Use correct logic to determine when to show the images.
Use different default icon for folders and records.
Clear the listener for load event on image when exiting the document