working on sockets and images