Simple javascript code to detect image render of navigator