add picture preview function