updated to include image preview