Fixed upload photo js method