still debugging the removing image javascript function