To get the photo from a message, use the request:
http://{host}/avl_msg_photo?sid=<sid>&layerName=<text>&msgIndex=<uint>
Returns photo.