add jpg image support, improve layout