A man who had more than 300 indecent images of children on his mobile phone, has been jailed.