fixeed bug in img display

also extraxted socket io stuff to external module