improved image preview
bug fixes