one method of using ajax to get img data