You've registered this plugin to execute on the Update event of the Student entity, correct? Then, chances are the exception you're getting is going to be a complaint about an infinite loop... because you're triggering another update from within your update. Your service.update call starts the update pipeline on the given record all over again.
If you click the 'download log file' link on the error dialog that CRM is popping up, check the Message and the InnerFault fields to see if additional further info is included.
CRM keeps track of the call stack depth during plugin calls, and will throw the 'infinite loop' fault if the depth limit is exceeded. (See articles here and here.)
If you must update the current record during an update, there are a couple of workarounds: either check the call stack depth at the start of your plugin and do nothing if it's over an expected value (not the ideal solution but it does work), or check for the present (or absence) of an expected attribute and code accordingly. For example, in your scenario you might compare the ave_contactid attribute in the preMessageImage object against the postMessageImage object. If this field is in the process of changing, don't change it again in your plugin.