A man has been jailed after he entered HMP Preston as a visitor with cannabis resin hidden inside his shoes.