Use 1) the HTML Service of Google Apps Script or 2) update a cell formula with the IMAGE() fuction, any of them triggered by a Custom Menu as Google Docs editors doesn't include a mouse hovering event.
Google spreadsheets and Google Apps Script (GAS) have had a lot of changes since the question was posted. One of them is that the GAS documentation was moved to http://developers.google.com/apps-script.
AFAIK GAS doesn't have a mouse hovering trigger event but there are several alternatives like custom menus, simple triggers and installable triggers.
By the other side, filling a cell with an image can be done with a built-in function, IMAGE(), which have four image sizing modes.
GAS an IMAGE() could be used together to insert an image inside a cell and this could be triggered by a custom menu.
Use Custom Menus instead of mouse hovering to trigger one of the next actions:
- Update a cell formula with the IMAGE() function.
Use a method of the UI Class like:
In both cases the image should be part of an htmlOutput object of the HTML Service.
About Notes and Comments
Built-in notes or comments are displayed by mouse hovering. They could include the image URL. Notes will display it as text while a comment as a link.
Once the user is in the Google Sheets spreadsheet editor.
- To insert a note click Insert > Note
- To insert a comment click Insert > Comment
About other UI resources
- toast, alert and prompt Google Apps Script methods shows plain text messages.
HTML Service: Restrictions
Script uses a security sandbox to sandbox HTML-service web apps or
custom user interfaces for Google Docs, Sheets, and Forms. (The HTML
service does not use a sandbox in other situations, like generating
the body of an email.) The sandbox imposes limitations on client-side