updated script to create img element and add img preview