fixing image upload and javascript issues