Added ID tag to img link
Added error icon
Added function breakdowns and enhanced selection handling to JS